When working on a home server, there are no problems with the command line. When I enter via ftp or via the editor built in my account there is no way to type a command.

    2 answers 2

    You need to log in to the server via ssh, then from the terminal you issue the chmod command or whatever you need. If the server is a free or paid hosting and you need to set permissions on the file, then many hosters give you the opportunity to do this from the control panel, you need to search a little in the settings.

    The chmod command itself is simple:

    chmod 777 -R папка 

    add the rights to read, write and execute the folder and all its contents recursively to everyone without exception, and

     chmod +x файл 

    will add permissions to the file. Usually on Unix systems, command help is shown as follows: man command (man chmod). On Ubuntu, some of the help is translated.

    If, for example, all users need to add read access to the download/files folder, then

     chmod a+r download/files 
    • I searched for a long time — it might be bad, but I found another Write an access file <? Require "dostup.php"; ?> But still, I would like to deal with this issue. I tried to run the command from TotalComander from the command line when logging in to ftp. It did not work. How do others do it on paid hosts? - Monstrs-Inc
    • I found my own “provider” info: Configuring PHP via .htaccessOn the Apache web server, it is possible to control folder operation modes. To do this, put the necessary commands in a file called .htaccess and download this file to the desired folder on the server. php_flag magic_quotes_gpc on (example) With these commands, you can change PHP settings that you would otherwise have to configure via php.iniWhat do you need to write to run chmod in .htaccess and how then to run this command? And where to find the php.ini file? - Monstrs-Inc
    • UNIX / Apache - CGI * through its own configuration file located in .php / php.ini in the root of your home directory; But it is not there. There are experts on this issue? - Monstrs-Inc
    • htaccess and chmod are completely unrelated things. chmod is a unix command, and htaccess is an apache settings file. You need to find out from your hoster 1) if there is access via ssh, if there are options in the control panel for changing permissions on files, or this or that should be 100%. - stanislav
    • I know that I have SSH access. I can also have my own php.ini. I also have the right to change permissions to files and folders. The php.ini file has already been found. I can tell you how to do it. Download putty to connect via SSH. But I don’t know how to set access rights to folders. I know all the keys for chmod. Example: It is necessary to set the access to the download / files folder only read. What team need to dial? - Monstrs-Inc

    Permissions for folders on the server should be set with code 755, but for files it is better to install with code 644 for your case: chmod -R 755 /ПУТЬ/download/files/ and then chmod -R 644 /ПУТЬ/download/files/*.*

    • Perhaps 'chmod -R 644 / PUT / download / files / *. *' Does not work for files in subfolders, you need to do this: 'find / PATH / download / files / -type f -exec chmod 644 {}' - Denis Ivlev