open_basedir problem after upgrade to PHP 5.2.15

SamotniQ

Verified User
Joined
Nov 21, 2008
Messages
17
Location
Poland
After upgrade to PHP 5.2.15 I saw a problem with open_basedir. On every website I see the message

Warning: Unknown: open_basedir restriction in effect. File(/home/xxx/domains/yyy/public_html/index.php) is not within the allowed path(s): (/home/xxx:/tmp:/usr/local/lib/php/) in Unknown on line 0

Warning: Unknown: failed to open stream: Operation not permitted in Unknown on line 0

Fatal error: Unknown: Failed opening required '/home/xxx/domains/yyy/public_html/index.php' (include_path='.:/usr/local/lib/php') in Unknown on line 0

I find something about this problem on website:
http://bugs.php.net/bug.php?id=53514&edit=1

Can anybody from DA Support patch the php sources for FreeBSD 6.X?
 
me too
please help!!



Solve this problem downgrade to 5.2.14

ekaja# md5 php-5.2.14.tar.gz
MD5 (php-5.2.14.tar.gz) = 6dff7429a1b43aa1c76a43e909215608

Edit & rebuild
/usr/local/directadmin/custombuild/versions.txt
php5:5.2.14:6dff7429a1b43aa1c76a43e909215608
./build php

and Wait solution for php 5.2.15
 
Last edited:
me too
please help!!



Solve this problem downgrade to 5.2.14



Edit & rebuild


and Wait solution for php 5.2.15

Thanks for solution. I hav the same problem and solved it by downgrading.

When md5 command gives error, that comand not found, then You need to use md5sum
 
Thanks for solution. I hav the same problem and solved it by downgrading.

When md5 command gives error, that comand not found, then You need to use md5sum

hi
my problem is no such file and directory
Code:
[root@main custombuild]# md5sum php-5.2.14.tar.gz
md5sum: php-5.2.14.tar.gz: No such file or directory
and i'm new with directadmin
 
hi
my problem is no such file and directory
Code:
[root@main custombuild]# md5sum php-5.2.14.tar.gz
md5sum: php-5.2.14.tar.gz: No such file or directory
and i'm new with directadmin

cd /usr/local/directadmin/custombuild
wget http://files.directadmin.com/services/custombuild/php-5.2.14.tar.gz
wget http://files.directadmin.com/services/custombuild/php-5.2.14-mail-header.patch

md5 php-5.2.14.tar.gz
MD5 (php-5.2.14.tar.gz) = 6dff7429a1b43aa1c76a43e909215608

Edit /usr/local/directadmin/custombuild/versions.txt. In this file find php5:5.2.15:dbbb2beed6b51e05d134744f137091a9 and replace it with php5:5.2.14:6dff7429a1b43aa1c76a43e909215608

Then run ./build versions and ./build update_versions
 
centos 64x here same problem
though on a other box , it went ok without any problems
 
Last edited:
On my system, even though I edit versions.txt to the older php 5.2.14, when I run ./build php it reverts it in versions.txt to 5.2.15.

I tried ./build versions and it also reverted it to 5.2.15. How do I tell the build process not to upgrade php and stick with 5.2.14?


Update: Never mind, found out I had autover=yes, changed it to 'no' and it no longer tried to be smart on me.
 
Last edited:
hi,
just for DA user that do not want downgrade manually, i written a very simple script to do it:

cd /usr/local/directadmin/custombuild
wget http://www.seflow.it/script/fix_da.sh
chmod 755 fix_da.sh
./fix_da.sh

Script simply download 5.2.14 php version, change versions.txt and options.conf (to switch autover on no), and recompile php.

Thank you
 
Everyone who wants to update to PHP 5.2.15 use the following commands (for now):
Code:
cd /usr/local/directadmin/custombuild
./build update
wget -O php-5.2.15.tar.gz http://files.directadmin.com/services/custombuild/php-5.2.15.tar.gz
perl -pi -e 's/php5:5.2.14:6dff7429a1b43aa1c76a43e909215608/php5:5.2.15:dbbb2beed6b51e05d134744f137091a9/' versions.txt
perl -pi -e 's|cd php-\$\{PHP5_VER\}|cd php-\$\{PHP5_VER\}\n\tperl -pi -e \"s#resolved_name\\[resolved_basedir_len\\]#resolved_name\\[resolved_basedir_len -1\\]#\" main/fopen_wrappers.c|' build
./build php n
 
Last edited:
I also have the same problem, i disabled all the websites open base dir.The situation is now normal.
@Smtalk, Should I still run the command
cd /usr/local/directadmin/custombuild
./build update
perl -pi -e 's|cd php-\$\{PHP5_VER\}|cd php-\$\{PHP5_VER\}\n\tperl -pi -e \"s#resolved_name\\[resolved_basedir_len\\]#resolved_name\\[resolved_basedir_len -1\\]#\" main/fopen_wrappers.c|' build
./build php n[/QUOTE
 
It is recommended to have open_basedir enabled for security.
 
Richard G, it's not a workaround, but a real fix :) You're welcome.
 
A fix would be that no extra lines would be necessary.:)
So oke, you made a Directadmin fix but a php workaround, because only php can make a real fix because it's a php bug.;)
Just another point of view.
 
Back
Top