downgrade PHP5.0.x to PHP4.3.x

deamen

Verified User
Joined
Jul 12, 2005
Messages
5
Hi there,

I've upgraded my php version from 4.3 to 5.0 according to this thread

I would like to go back to the old php version, but cannot get it to work. When I remove the php5 config rules from my httpd.conf and use the php4 rules again I do not get it to work.
I'm sure I'm missing something, but it's driving me crazy. Can you please help me out?

The PHP part of httpd.conf looks like this:
----------------------------------

<IfDefine HAVE_PHP>
LoadModule php_module modules/mod_php.so
</IfDefine>
<IfDefine HAVE_PHP3>
LoadModule php3_module modules/libphp3.so
</IfDefine>
<IfDefine HAVE_PHP4>
LoadModule php4_module modules/libphp4.so
</IfDefine>

<IfDefine HAVE_PYTHON>
LoadModule python_module modules/mod_python.so
LoadModule php4_module /usr/lib/apache/libphp4.so
</IfDefine>
LoadModule perl_module /usr/lib/apache/libperl.so


<IfDefine HAVE_PYTHON>
AddModule mod_python.c
</IfDefine>

<IfDefine HAVE_PHP>
AddModule mod_php.c
</IfDefine>
<IfDefine HAVE_PHP3>
AddModule mod_php3.c
</IfDefine>
<IfDefine HAVE_PHP4>
AddModule mod_php4.c
</IfDefine>


<IfModule mod_php4.c>
AddType application/x-httpd-php .inc .php .php4 .php3 .phtml
AddType application/x-httpd-php-source .phps
</IfModule>

<IfModule mod_php3.c>
AddType application/x-httpd-php3 .php3
AddType application/x-httpd-php3-source .phps
</IfModule>
<IfModule mod_php.c>
AddType application/x-httpd-php .phtml
</IfModule>


---------------------------------

At the end pf the config file it's including all sie specific config:
Include /usr/local/directadmin/data/users/XXXXXX.conf

When I do a test I receive this error message:


[root@serve modules]# apachectl configtest
Warning: DocumentRoot [/usr/local/frontpage/version5.0/admin-exes] does not exist
Syntax error on line 31 of /usr/local/directadmin/data/users/XXXXX/httpd.conf:
Invalid command 'php_admin_flag', perhaps mis-spelled or defined by a module not included in the server configuration




I also tried to rebuild php form the customapache, but this doesn't fix the problem

./build update
./build php

Thanks in advance for your help:D
 
You will need to recompile php4 through customapache. Make sure that it is doing that.
./build clean
./build update
aswell as checking that build is downloading the right sources (php4 sources).

Once php4 is working from the command line, you have narrowed it down to apache and most likely a syntax problem.
I modified DirectAdmin's template removing all of the <IfDefine.... stuff because it was causing problems.
 
I've changed the following lines in my httpd.conf and it's working now!


#<IfDefine HAVE_PHP4>
AddModule mod_php4.c
#</IfDefine>



Thanks for your help!
 
Yep, I removed all that. There's no point having checks for older version of php, python, perl etc since I know what my servers have.
 
Back
Top