I'm logging in to my server with my ec2-user account (using FileZilla). I want to replae the PHP.ini that is in the /etc folder with a pre-made file of my own.
The thing is I don't have permissions to do so and I can't figure a way to replace this file.
I can't login with the root to FileZilla (is there a way to do it?) and I'm not sure if I can use sudo as part of the FileZilla application.
I tried to chown the whole /etc folder under ecw-user, but that endedup with me getting /etc/sudo.conf is owned by uid 500 should be 0 message for every command I'm trying to do.
What should I do?
I ended up changing the permission just to the PHP.ini and not the whole etc directory using:
sudo chown ec2-user <file_name>
This enabled me to replace the file.
Related
I am running an apache webserver on a virtual machine on my pc. The vm is running zorin linux. I have written a php script that writes some data to another text file in the same directory. Both files are located in /var/www/html/. I have already verified that the webserver user is www-data, and I have attempted to make that user owner of the /var/www/html directory, as well as everything within that directory. Here is the command that I have used to do this:
sudoo chown -R www-data /var/www/html/*
I have also verified that the www-data user is the owner of this directory and it's contents using
ls -dl /var/www/html/
ls -dl /var/www/html/*
both return that the owner is www-data.
Even after doing all of this, the php file is still unable to write to the file correctly. At this point I am stumped. Any help would be greatly appreciated.
I want to change my default php.ini file configuration on amazon-ec2 AMI instance.i can access any my instance using putty and filezila.
This is only for php version 7.1 or greater.
Conncet your instance using filezila or winSCp .
Navigate to /etc folder.
you can see .ini file at bottom name php-7.1.ini.
using filezila right click on that file and click File Permissions.
If your file permission is 777 then good to go or it is any other than 777 then change it permission using command line interface just remember it's current permission.
use this command to change permission sudo chmod 777 /etc/php-7.1.ini
Now you can edit your .ini file.
After edit your file set back to it's previous permission to 644 or whatever your default ini permission using this command sudo chmod 644 /etc/php-7.1.ini.
And it's done dont forgot to restart server using this command sudo service httpd restart.
I cannot seem to allow permissions in vagrant. I am attempting to run importbuddy.php in order to migrate a WordPress instance. I get the following error.
file_put_contents(/path/): failed to open stream: Permission denied
I have setup permissions to 777 on the www directory, but that changes nothing. Any idea on how to fix this?
While recursively setting folder and file permissions to 777 should fix your problem (instructions for doing so here), the root of this is probably an issue with the ownership of the files and folders.
The owner of shared folders is usually 'vagrant' but the server itself (if you're using Ubuntu) runs as user and group 'www-data'. You can view the user/group of your files by sshing into your VM (vagrant ssh), navigating to the directory in question and entering ls -l in your console.
If you're running apache, then you can update the user to 'vagrant' by editing the following file (/etc/apache2/envvars) like below:
Find this section
export APACHE_RUN_USER=www-data
export APACHE_RUN_GROUP=www-data
And change it to
export APACHE_RUN_USER=vagrant
export APACHE_RUN_GROUP=vagrant
Afterward just be sure to restart apache (with this command sudo service apache2 restart) and the file permission errors should be fixed
I have installed linux centos 7 on a VmWare in Windows.
There are two users in the linux: root, sample
I have created a laravel project with user "sample" (logged in as sample), but when I try to run the project with user root (logged in as root), it throws a permission error that cannot write to the file (file_put_content()). I have tried
chmod 777 /var/www/html/laravel
Or even I have tried to change the permission of the write-access of the file to root using right-click->properties->permission, but to no avail.
The only possible solution has been to delete the file and re-create it with user root. Now, what is the solution? I though user root is privileged to do anything. But it seems it is not the case. What is the solution? How should change this issue?
Try chmod 777 -R /var/www/html/laravel/ ,-R is recursive
I downloaded CakePHP and put it in my www directory. I enabled mod-rewrite and all that and changed my document root. But I still get permission denied errors in my apache error log because Cake can't require the files from other directories. It's almost as if I need to chmod every single directory to 777 in order to make this work. I know that's not right but can someone tell me if I did not install it correctly or what to CHMOD. Because so far it's literally every folder I'm going through CHMODing right now.
Try
chown -R <webserver_user> <cake_dir> #set the owner of your cake dir recursively to your webserver
chmod -R 755 <cake_dir> #set the permissions recursively
you can get the webserver user with
ps -aux | grep apache #or whatever your web server is