I have installed xampp and wordpress, which I run on my local host. When I try to make changes, eg. remove plugins it keeps asking me for the following:
hostname
FTP username
FTP password
I know the username and the password but I don't know what to type in hostname. I tried "localhost" or path to the actual wp Wordpress folder (/Applications/XAMPP/xamppfiles/htdocs/projects/wp)- both don't work.
Please note that I have granted all permissions to this user. I feel that the hostname I put is wrong.
Can you please help me out with this? I'm stuck on this (I guess) basic step and can't do anything more.
First of all, go to wp-config.php and add this line after the
#package WordPress
define( 'FS_METHOD', 'direct' );
then open the Terminal and paste this:
sudo chmod -R 777 /Applications/XAMPP/xamppfiles/htdocs/
followed by your system password
Done and done!
A usefull video about installing Xampp correctly.
Change in your php.ini after
#package Wordpress
define( 'FS_METHOD', 'direct' );
And change your directory to 777 and the files to 644 in your terminal:
sudo find /Applications/XAMPP/xamppfiles/htdocs/ -type d -exec chmod 777 {} \;
sudo find /Applications/XAMPP/xamppfiles/htdocs/ -type f -exec chmod 644 {} \;
Good luck!
Related
I have developed a laravel app and host it to my private server using WinSCP. But when I hit myurl it's showing me The stream or file "/var/www/html/vesMain/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied and if I set APP_DEBUG=flase then it's showing 500 error``192.168.41.81 is currently unable to handle this request. but I I saw the file permission is 644. I don't know why this is happening? Can anyone have any suggestion?
I solved my problem using set the permission 777 to storage folder, logs folder and laravel.log file. Then set permission 777 view folder that inside into storage/framework/view and session(storage/framework/session) folder. Finally, clear the route and cache.
You can simply run those command.
sudo chmod -R 0777 /var/www/html/your_app/storage
sudo chmod -R 0777 /var/www/html/your_app/storage/logs
sudo chmod -R 0777 /var/www/html/your_app/storage/logs/laravel.log
sudo chmod -R 0777 /var/www/html/your_app/storage/framework/view
sudo chmod -R 0777 /var/www/html/your_app/storage/framework/session
Then just clear cache and route
php artisan cache:clear
php artisan route:clear
Giving 777 permission is not at all a good practice. Its like you are giving authority to anyone to change your code. Try 775
UPDATE** The screenshot is within atom, but when I navigate to the directory using the file explorer, and right click, the option to rename or create a new folder are restricted and I cannot click on them.
I just finished setting up the LAMP stack on my fresh UBUNTU 18.04 installation. I have everything working, the default /var/www/html/index.html page from Apache2 is being served on localhost, no port forwarding or any unique domain name, i just wanna run this on my network from my computer for now.
If there is a simple way to create multiple websites and easily choose which folder to serve than that's fine, but I want to serve just one website for now.
When I go to my /var/www/html folder and try to edit the index.html file it says permission denied. What do I need to do in order to work inside this directory for the remaining time that I am building the website. I am signed in as the root user on my system.
Also, if I do change permissions to allow me to work in this directory, what does it mean for people trying to access my server if it was available to the public. (RIGHT NOW JUST ON LOCALHOST).
Lemme know if you need more info or explanation thanks!
sudo chown -R $USER:$USER /var/www
this works, it changes the owner to my user instead of root user. I still don't understand because my user already had sudo rights and all those permissions. It was the user I created during the ubuntu18.04 setup, so there shouldn't be an issue, or idk.
File ownership issues can be fixed at the command line by typing:
sudo chmod 777 /var/www/html -R
One caveat from
turnkeyLinux.com:
Changing file permissions is a trade off
(often increasing security reduces user-friendliness and/or
usability). For security 'best practice' only the folders that require
write access by the webserver should be owned by the webserver.
If your webserver has write access everywhere and your server
is compromised it makes it easier to hack your WordPress install) but
for ease of use giving the webserver ownership should resolve all your
issues...
This article on Understanding File Permissions was great, too.
This will help you.
sudo chgrp -R www-data /var/www/html
sudo gpasswd -a username www-data
sudo chmod -R 777 /var/www/html
The permission error is occurring because the folder does not have the rights and rights are reserved with different user. (you can inspect this by doing ls -l folderName)
The solution for your problem can be handled in different ways following are the few :
WAY1:
Find out who is running apache by running the command apachectl
-S
Locate the user name (say www-data)
Change the ownership of your folder as chown -R www-data:www-data /var/www/html (this will allow only your apache
to play with files)
Run the following command ln -s /var/www/html /home/username/html (this will create a soft link for your folder,
where you can edit/delete/read which will reflect on your apache)
WAY2:
goto /var/www/
sudo chown -R www-data:${USER} html
(Now both apache and your loged-in user will have rights to play with file).
If you are not root or you don't have a permission on some things(folder,files..), know that your actions are limited.
Take folder as example:
first of all verify permissions of your folder
==>ls -ld linkto/folder
and after give it a permissions it need or type the command bellow to add all permissions
==>sudo chmod -R 777 /var/www/html
verify permissions of your folder again if it is correct then try to copy again
Just write
And give read and write rights to the folder ( not user )
Try the following the command
For Read and Write:
sudo chmod -R a+rw /var/www
For Read, Write and Execute:
sudo chmod -R a+rwx /var/www
Edit the file as root. Or better yet fix your permissions so you don’t have to worry.
I want to install Magento 2 on Centos 7, during installtion, file write permission error display as following:
File Permission Check
4 file permission not met. Hide detail
The best way to resolve this is to allow write permissions for files in the following Magento directories and subdirectories. The exact fix depends on your server, your host, and other system variables.
For help, see our File Permission Help or call your hosting provider.
"/var/www/html/app/etc" - Not writable, change the permissions.
"/var/www/html/var" - Not writable, change the permissions.
"/var/www/html/pub/media" - Not writable, change the permissions.
"/var/www/html/pub/static" - Not writable, change the permissions.
Then I gave command via ssh:
1. sudo chown -R apache:apache /var/www/html
2. sudo find var vendor pub/static pub/media app/etc -type f -exec chmod u+w {} \;
3. sudo find var vendor pub/static pub/media app/etc -type d -exec chmod u+w {} \;
But the error is still in there, so how to give this file write permission.
Try chmod -R a+w /path/to/folder/
chcon -R -t httpd_sys_rw_content_t /path/to/folder/
if selinux is enable
So when I try to use:
fopen("sometext.txt", "w") or die("blahblahbla");
I keep on getting the following message:
failed to open stream: Permission denied". I have looked for other
answers on this site and none of them actually work.
Why is this doing this? Can somebody recommend a fix?
Do I have permission to create files in my directory? I get a bunch of advice on using chmod or changing the "file access", but how do you do this? They never explain that, just "oh use this or that".
If you have Terminal Access just fire a command in file's folder:
sudo chmod 777 sometext.txt ( For security reasons, later use correct chmod for permission)
if you dont have, you can modify File Attributes in your FTP client. ( Tick all fields (Execute-read-write) for Owner, Group, Everyone).
I hope it will solve your problem.
First, make sure you are in the apache group (check it with id username), then add your user to group apache (sudo usermod -G apache -a username) and then make sure the directory is in the group apache (check it with ls -l directory. I suppose the directory is /var/www/html or /srv/whatever, but XAMPP has its own. If not, do a sudo chgrp apache directory. Also, the directory must be writable by group members (chmod g+w directory).
Obviously in the apache configuration must be the apache user and group. If they doesn't exist, create them (sudo groupadd apache and sudo useradd apache).
P.S: chmod 777 is evil! It's better to be in the apache group and avoid making your file be edited by someone else!
I'm a new fish for hadoop.I installed Ubuntu 12.10 on my computer and I wanna install Hadoop in pseudo-distributed mode on one single node.I searched and get lots of tutorials but I have a problem with the SSH.I did what the tutorial said.
I am sure the problem is about the SSH.I get the openssh-server,and had done this:
hadoop00#WebsoftStation:~$ssh-keygen -t dsa -P "" -f ~/.ssh/id_dsa
hadoop00#WebsoftStation:~/.ssh$cat ~/.ssh/id_dsa.pub >> authorized_keys
Then I can successfully ssh my localhost like this:
hadoop00#WebsoftStation:~$ssh localhost
It worked.
So I changed the path to hadoop and then:
hadoop00#WebsoftStation:/usr/local/hadoop$ sudo bin/start-all.sh
[sudo] password for hadoop00:
starting namenode, logging to /usr/local/hadoop/libexec/../logs/hadoop-root-namenode-WebsoftStation.out
root#localhost's password:
root#localhost's password: localhost: Permission denied, please try again.
So,what's the problem?
You have setup password-less ssh for only your current account. Since, when you can use ssh localhost without any problem, the thing you need to do next is giving execution permission to your scripts.
Execute the following commands:
chmod +x bin/*.sh ---> assigns execution permission to all the scripts
./start.all ----> executes the script
Note: Hadoop can also be run without having password-less ssh setup using hadoop-daemon.sh script. The only advantage with password-less ssh is that, the ./start.all, script will take the trouble of doing that on behalf of you in each of the nodes.
You need to change permissions for your Hadoop folder to be owned by the hadoop00 user:
cd /usr/local/
sudo chown -R hadoop00:hadoop00 /usr/local/hadoop
Then you can cd into the sbin folder and run things without sudo. If you use sudo you're running the scripts as root which has different environment variables etc which is why you have a different behavior.
Why are you using sudo this is clearly a permission problem.
Try running this without sudo
bin/start-all.sh