
17th December 2005, 15:59
|
|
Junior Member
|
|
Join Date: Oct 2005
Location: Bosnia and Herzegovina
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
php safe mode warning
Hi,
I upgraded few days ago PHP on my SuSE 9.2 server with ISPConfig on 4.4 version (from 4.3.11) and apache 2.0.51 on 2.2, and on sites that have PHP Safe mode enabled, I get error message like this:
Warning: Unknown(): SAFE MODE Restriction in effect. The script whose uid is 0 is not allowed to access /home/www/web20/phptmp owned by uid 10016 in Unknown on line 0
Owners of php scripts and phptmp are the same, and file/dir permissions are 777 for phptmp and 755 for php scripts
Since PHP Safe mode is disabled in php.ini, and enabled for each site through ISPConfig, I guess this issue has nothing to do with settings in it...
What could be wrong?
|

17th December 2005, 17:08
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,665
Thanks: 1,896
Thanked 2,593 Times in 2,444 Posts
|
|
Please compare the owner and group of the PHP script and of the /home/www/web20/phptmp directory. They have to be the same.
|

17th December 2005, 18:05
|
|
Junior Member
|
|
Join Date: Oct 2005
Location: Bosnia and Herzegovina
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
The thing that is strange is that user/group for phptmp and php scritps are the same:
Code:
ns3:/home/www/web20 # ls -la phptmp/
total 2
drwxrwxrwx 2 web20_admin web20 1024 Nov 28 23:59 .
drwxr-xr-x 8 web20_admin web20 1024 Dec 15 08:58 ..
-r-------- 1 root root 0 Nov 28 06:19 .no_delete
ns3:/home/www/web20 #
ns3:/home/www/web20/web # ls -la *.php
-rwxr-xr-x 1 web20_admin web20 50589 Jul 4 00:15 SSI.php
-rwxr-xr-x 1 web20_admin web20 3534 Nov 28 07:03 Settings.php
-rwxr-xr-x 1 web20_admin web20 3220 Jun 23 00:15 Settings_bak.php
-rwxr-xr-x 1 web20_admin web20 13687 Jul 13 20:59 index.php
-rwxr-xr-x 1 web20_admin web20 5181 Jun 23 00:15 ssi_examples.php
|

18th December 2005, 15:18
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,665
Thanks: 1,896
Thanked 2,593 Times in 2,444 Posts
|
|
Do you have any include files in your PHP script that have wrong permissions?
|

19th December 2005, 12:50
|
|
Junior Member
|
|
Join Date: Oct 2005
Location: Bosnia and Herzegovina
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
There should be no includes outside of web directory of the script, actually it's a forum script (SMF), and I did: chown -R web20_admin:web20 web/ to be sure there's no files or dirs with wrong owners there...
I got the same error on some other sites, but since they have quiet simple php scripts, I turned off safe mode so they can work OK...
I'm compiling PHP 5.1.1 right now on the server, to try it out, maybe SuSE made something strange in updated rpm's on their ftp server
|

19th December 2005, 15:14
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,903
Thanks: 693
Thanked 4,193 Times in 3,211 Posts
|
|
What is the setting of the include path in your php.ini?
|

19th December 2005, 20:07
|
|
Junior Member
|
|
Join Date: Oct 2005
Location: Bosnia and Herzegovina
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Include path is commented, so it shouldn't make trouble, but I have this enabled:
Code:
extension_dir = "./"
extension_dir = /usr/lib/php/extensions
Could this make trouble?
|

19th December 2005, 20:58
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,665
Thanks: 1,896
Thanked 2,593 Times in 2,444 Posts
|
|
Quote:
|
Originally Posted by sc0ut
Include path is commented, so it shouldn't make trouble, but I have this enabled:
Code:
extension_dir = "./"
extension_dir = /usr/lib/php/extensions
Could this make trouble?
|
I don't have any extension_dir directive in my php.ini... I suggest that you comment them out and restart Apache to see if that changes anything.
|

19th December 2005, 22:30
|
|
Junior Member
|
|
Join Date: Oct 2005
Location: Bosnia and Herzegovina
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Code:
ns3:/usr/lib/php/extensions # ls
. dbase.so gettext.so mcrypt.so shmop.so wddx.so
.. dbx.so gmp.so mhash.so snmp.so xslt.so
bcmath.so domxml.so iconv.so mime_magic.so sockets.so yp.so
bz2.so exif.so imap.so mysql.so swf.so zlib.so
calendar.so filepro.so ldap.so pgsql.so sysvsem.so
ctype.so ftp.so mbstring.so qtdom.so sysvshm.so
curl.so gd.so mcal.so session.so unixODBC.so
ns3:/usr/lib/php/extensions #
php.ini comment says that this directory is: Directory in which loadable extensions (modules) reside.
I tried to comment it, restart apache, but got the same error on pages...
|

19th December 2005, 23:47
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,665
Thanks: 1,896
Thanked 2,593 Times in 2,444 Posts
|
|
Quote:
|
Originally Posted by sc0ut
Warning: Unknown(): SAFE MODE Restriction in effect. The script whose uid is 0 is not allowed to access /home/www/web20/phptmp owned by uid 10016 in Unknown on line 0
|
Can you have a look at /etc/passwd to find out which user has the id 10016?
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +2. The time now is 01:07.
|
|
Recent comments
19 hours 19 min ago
1 day 2 hours ago
1 day 5 hours ago
1 day 7 hours ago
1 day 15 hours ago
2 days 1 hour ago
2 days 2 hours ago
2 days 5 hours ago
2 days 10 hours ago
2 days 10 hours ago