dibyajyotig Posted February 4, 2008 Share Posted February 4, 2008 Hi friends, ??? i m really puzzled with the following error i m getting with my php-script... i actually want to design a form in php, which will take some job information (text format only) from user... and will create an xml file named job1.xml. if he wants to submit more jobs, then he will again enter its info and job2.xml will be created... that way it will go on creating new files....till FINISH button is pressed.. but i m not getting rid of the following error.... my platform is - apache2.2 , php5 , linux(fedora core 7) Warning: fopen(xml_files/job1.xml) [function.fopen]: failed to open stream: Permission denied in /opt/lampp/htdocs/phpxml/index.php on line 44 NOTE : but the same script is working in windows platform...absolutely fine!! Quote Link to comment https://forums.phpfreaks.com/topic/89322-permission-denied-to-fopen-function/ Share on other sites More sharing options...
pdkv2 Posted February 4, 2008 Share Posted February 4, 2008 You need to set the write permission to the apache user for the directory where you are creating the files. Quote Link to comment https://forums.phpfreaks.com/topic/89322-permission-denied-to-fopen-function/#findComment-457445 Share on other sites More sharing options...
dibyajyotig Posted February 5, 2008 Author Share Posted February 5, 2008 thanks a lot!!! But , how can i do that? pls tell me ASAP. i m waiting.... Quote Link to comment https://forums.phpfreaks.com/topic/89322-permission-denied-to-fopen-function/#findComment-458576 Share on other sites More sharing options...
pdkv2 Posted February 5, 2008 Share Posted February 5, 2008 to change the permission to write the directory chmod 750 /path/to/directory And to change the user and group chown -R user.group /path/to/directory thats all Cheers! Quote Link to comment https://forums.phpfreaks.com/topic/89322-permission-denied-to-fopen-function/#findComment-458577 Share on other sites More sharing options...
dibyajyotig Posted February 5, 2008 Author Share Posted February 5, 2008 yup!! i have done all that u told.. but still i m getting the same error message!! moreover i m working as root. is there any way out?? Quote Link to comment https://forums.phpfreaks.com/topic/89322-permission-denied-to-fopen-function/#findComment-458622 Share on other sites More sharing options...
pdkv2 Posted February 5, 2008 Share Posted February 5, 2008 see the user list in your /etc/apache2/uid.conf file and use that user for setting the file permissions Quote Link to comment https://forums.phpfreaks.com/topic/89322-permission-denied-to-fopen-function/#findComment-458638 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.