Results 1 to 7 of 7
Hi
I am new to the admin on the linux apache VPS. php is running OK except that I cannot get the basic php mkdir() command to work. I think ...
- 06-04-2009 #1Just Joined!
- Join Date
- Jun 2009
- Location
- Plymouth UK
- Posts
- 5
[SOLVED] mkdir() problem on linux apache VPS
Hi
I am new to the admin on the linux apache VPS. php is running OK except that I cannot get the basic php mkdir() command to work. I think there is a directory permission problem? From the shell command level I have tried chmod 777 directoryname, and also
chown -R apache:apache directoryname
but still it won't create a directory (but mkdir() works on a shared host I am running). Any ideas?
Grilly
- 06-04-2009 #2Linux Newbie
- Join Date
- Nov 2007
- Location
- Planet Earth
- Posts
- 152
You're right with permissions of your directory. Unless there is a problem with your code, probably your PHP installation has security options enabled (restricted functions, safe mode, or something similar)... check your php_info() to find that configurations.
EOF
- 06-04-2009 #3Just Joined!
- Join Date
- Jun 2009
- Location
- Plymouth UK
- Posts
- 5
mkdir() on linux apache server
Thanks Hugortega
php code is simple and OK - it works on a shared host.
Using vhost.conf I have set the php v5.2.9 to safe_mode 0 (off) and open_basedir none. This is shown by php_info().
Grilly
- 06-04-2009 #4Linux Newbie
- Join Date
- Nov 2007
- Location
- Planet Earth
- Posts
- 152
Also, there is a bug with some version (I think 5.2) of PHP that have problems with trailing slashes on paths... I mean, mkdir("foo/path/") will not work, but mkdir("foo/path") will do the job.
EOF
- 06-04-2009 #5Just Joined!
- Join Date
- Jun 2009
- Location
- Plymouth UK
- Posts
- 5
mkdir() on linux apache server
Thanks
Yes - I found that / is important before the dir name eg /temp. It didn't work without it. Also, I needed the $_SERVER[] command. The php command that worked in the end was
mkdir($_SERVER['DOCUMENT_ROOT']."/temp/newdir");
after I had done
chown -R apache:apache temp
THis created newdir. Thanks for your help
Graham
- 06-04-2009 #6Linux Newbie
- Join Date
- Apr 2008
- Location
- India
- Posts
- 170
tmp has noexec ...check that
Regards
David.s
davidanands.co.cc
-->Success is the list of failures ...!!!
- 06-05-2009 #7Just Joined!
- Join Date
- Jun 2009
- Location
- Plymouth UK
- Posts
- 5
mkdir() problem on linux apache VPS
Thanks david
Now have it going. Needed to use mkdir($_SERVER['DOCUMENT_ROOT']."/temp ...
Graham



