Reputation: 151
Hello I have this problem that I am trying to save a file to a directory on htdocs it says permission denied.
<?php
$image = file_get_contents('http://www.affiliatewindow.com/logos/1961/logo.gif');
file_put_contents('./images/myFile.gif', $image);
Upvotes: 3
Views: 6570
Reputation: 1
You can grant write Permissions to others and group targeting the htdocs directory using the following command:
sudo chmod -R 777 /opt/lampp/htdocs
Upvotes: 0
Reputation: 586
You have to allow the permission to insert the image into the specific folder which is in htdocs for an example In ubuntu
sudo chmod 644 /opt/lampp/hdocs/yourfolder
like wise you have to give permission to access that specific folder
Upvotes: 3