Saturday, July 30, 2016

linux - PHP Mkdir not working - Full permission



Our server is a Linux Server with Debian 5, Apache2



This is a development server which we are doing testing on and as such we have setup world write permission on everything



Ive also set the umask in /etc/profile to 000



One particular PHP script loops through some images in a directory and attempts to make thumbnails in a sub directory




the PHP Error we receive is "Warning: mkdir() [function.mkdir]: No such file or directory"



apache2 runs as user www-data, I can login as www-data and make directories and files and everything with no problem



the apache error log just says File does not exist



Any suggestions?


Answer



Is the path its trying to create there ? ie if its trying to create /var/www/images/thumb/ then /var/www/images/ needs to exist. It may also pay to enable recursive creation mkdir(/var/www/images/thumbs, 0, true)



No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...