Help - Search - Members - Calendar
Full Version: HOW-TO: php4 + php5
The Planet Forums > Control Panels > Ensim > Ensim HOWTOs
mta
Recently our organization experienced the need to install PHP5 in coexistance with PHP4 on a high security site. I intend to explain how this was accomplished.
The server in question is running EPL 4.0.3-22fc1; however this guide should apply to any Linux operating system with Ensim installed.

Note: No changes are made to the PHP4 installation or any part of Ensim's core configuration.

Overview:
Per Ensim default, the PHP4 cgi within the high security vritual site is called via /var/www/interpreters/php-script. I created a similar /var/www/interpreters/php5-script which included the path to the PHP5 binary. I then added Action and AddHandler lines to the virtual site's Apache configuration which caused files with the .php5 extension to be handled by PHP5. I also added sections to the Apache configuration which caused httpd to use PHP5 ( instead of PHP4 ) to interpret files ending in .php.

Step by step:
These instructions assume that the PHP5 distribution is installed under /usr/local/php5 and that the PHP5 ini is /etc/php5.ini.

Copy the php5 directory and php5.ini to the desired virtual site:
cp –r /usr/local/php5 /home/virtual/site12/fst/usr/local
cp /etc/php5.ini /home/virtual/site12/fst/etc


Now we’re going to copy the helper php-script to php5-script:
cp /home/virtual/site12/fst/var/www/interpreters/php-script /home/virtual/site12/fst/var/www/interpreters/php5-script
chown admin12:admin12 /home/virtual/site12/fst/var/www/interpreters/php5-script

With the text editor of your choice, open /home/virtual/site12/fst/var/www/interpreters/php5-script and change /usr/bin/php to read /usr/local/php5/bin/php

Now for the apache configuration. With the text editor of your choice, open a new file named /etc/httpd/conf/site12/php5 and type in the following lines to enable PHP5 for files with the .php5 file extension:
Action php5-script /interpreters/php5-script
AddHandler php5-script .php5


You can additionally enable PHP5 on a per directory basis by adding a section like this:

Action php5-script /interpreters/php5-script
AddHandler php5-script .php


Finally, reload apache:
service httpd reload
Catalyst
oooh, and you can always change it on a per-directory basis by adding an .htaccess file to the directory of your choice:
CODE
AddHandler php5-script .php
Saves you from messing with the Apache config each time you wanna add a new directory! :-)
luke_s
mta,

Thanks for the How-To.

Did you manually compile PHP5 to the prefix directory of /usr/local/php5 in order to get the PHP5 binary? I ask because when I do this the configure script tells me that I need libxml2 version 2.6.11 or greater. The problem is that I'm pretty sure that installing this library might damage Ensim. Did you encounter this issue?

Thanks,

Luke
Catalyst
Install the libxml2-devel package and you're good. Here's a good compile line:
CODE
./configure --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu

--target=i386-redhat-linux-gnu --prefix=/usr/local/php5

--cache-file=../config.cache --with-config-file-path=/etc/php5.ini

--enable-force-cgi-redirect --disable-debug --enable-pic

--disable-rpath --enable-inline-optimization --with-bz2

--with-db4=/usr --with-curl --with-freetype-dir=/usr

--with-png-dir=/usr --with-gd --enable-gd-native-ttf

--without-gdbm --with-gettext --with-ncurses --with-gmp

--with-iconv --with-jpeg-dir=/usr --with-ssl --with-png

--with-regex=system --with-xml --with-expat-dir=/usr

--with-dom=shared,/usr --with-dom-xslt=/usr

--with-dom-exslt=/usr --with-xmlrpc=shared

--with-pcre-regex=/usr --with-zlib --enable-bcmath --enable-exif

--enable-ftp --enable-magic-quotes --enable-sockets

--enable-sysvsem --enable-sysvshm --enable-discard-path

--enable-track-vars --enable-trans-sid --enable-yp

--enable-wddx --enable-soap --with-snmp=shared --without-oci8

--with-imap=shared --with-imap-ssl --with-kerberos

--with-ldap=shared --with-mysql=shared --with-pgsql=shared

--with-unixODBC=shared --enable-memory-limit --enable-bcmath

--enable-shmop --enable-calendar --enable-dbx --enable-dio

--enable-mcal --enable-mbstring=shared --enable-mbstr-enc-trans

--enable-mbregex --with-pic --enable-force-cgi-redirect

--enable-fastcgi
Takes care of a few "missing" bits.
luke_s
Thanks a ton Catalyst. When you say I should install the libxml2-devel package do you mean an Ensim package or a RHE package? I am concerned that updating libxml2 might break Ensim since it will alter the Python libraries as well - right?

Thanks,

Luke
Catalyst
RHE ... nah, it's fine. It's just a development library that throws a bunch of stuff in your /include dirs. It definitely doesn't modify Python at all.


The easiest way is to follow the howto using the configure line I dropped, follow the hoto, and skip the Apache portion --- you don't even need to restart apache. Drop the .htaccess file I mentioned into whatever directory you want to run PHP5, and you should be all good.

I'm glad MTA brought this up... Basic, but brilliant. :-) Backwards compatibility doesn't get broken at all and you're able to flip back and forth to test your apps. You can really appease everyone this way.
webexceed
Thanks for this!!!

I might answer my own question before anyone sees this, but I'm making my way through and don't see /etc/php5.ini (just finished the 'make install' of php)

Anyone have a clue? (I sure don't seem to) lol

(sheepish grin> Nevermind, got it. icon_biggrin.gif
webexceed
So close..yet so far. OK, I now get this in my error log when trying to view any php5 page (I get a 500 Internal Server Error on the web page):

[Fri Dec 09 22:46:02 2005] [error] [client 70.XX.XX.19] /usr/local/php5/bin/php: relocation error: /usr/local/php5/bin/php: undefined symbol: xmlParserInputBufferCreateFilenameDefault
[Fri Dec 09 22:46:02 2005] [error] [client 70.XX.XX.19] Premature end of script headers: php5-script

My ./configure script was:

QUOTE
./configure --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu
--target=i386-redhat-linux-gnu --prefix=/usr/local/php5
--cache-file=../config.cache --with-config-file-path=/etc/php5.ini
--enable-force-cgi-redirect --disable-debug --enable-pic
--disable-rpath --enable-inline-optimization --with-bz2
--with-db4=/usr --with-curl --with-freetype-dir=/usr
--with-png-dir=/usr --with-gd --enable-gd-native-ttf
--without-gdbm --with-gettext --with-ncurses --with-gmp
--with-iconv --with-jpeg-dir=/usr --with-ssl --with-png
--with-regex=system --with-xml --with-expat-dir=/usr
--with-dom=shared,/usr --with-dom-xslt=/usr
--with-dom-exslt=/usr --with-xmlrpc=shared
--with-pcre-regex=/usr/local --with-zlib --enable-bcmath
--enable-exif --enable-ftp --enable-magic-quotes --enable-sockets
--enable-sysvsem --enable-sysvshm --enable-discard-path
--enable-track-vars --enable-trans-sid --enable-yp
--enable-wddx --enable-soap --with-snmp=shared --without-oci8
--with-kerberos --with-mysql=shared --enable-memory-limit
--enable-bcmath --enable-shmop --enable-calendar --enable-dbx
--enable-dio --enable-mcal --enable-mbstring=shared
--enable-mbstr-enc-trans --enable-mbregex --with-pic
--enable-force-cgi-redirect --enable-fastcgi --with-openssl
--with-mcrypt=/usr/local/libmcrypt --with-libxml-dir=/usr/lib


Those last 3 things are required for some software I am going to be running....and I have my suspicions that my trouble related to --with-libxml

The libxml files are all there in /usr/lib as well as in /home/virtual/sitexx/fst/usr/lib

EDIT: SIGH, I sure wish I could delete these. icon_biggrin.gif Installed latest libxml and all is well for now. icon_biggrin.gif
luke_s
Hey guys,

I have php5 installed as directed, but I'm getting
HTML
Call to undefined function mysql_connect()
when opening my application pages. Now, I know that this is usually related to the fact that php5 does not have native support for mysql, but I thought I had compiled PHP5 with mysql support. Is there more that I need to do to get MySQL support?

here is my config commmand:
QUOTE
'./configure' '--host=i686-pc-linux-gnu' '--build=i686-pc-linux-gnu' '--target=i386-redhat-linux-gnu' '--prefix=/usr/local/php5' '--cache-file=../config.cache' '--with-config-file-path=/etc/php5.ini' '--enable-force-cgi-redirect' '--disable-debug' '--enable-pic' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-db4=/usr' '--with-curl' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-gd' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-ncurses' '--with-gmp' '--with-iconv' '--with-ssl' '--with-png' '--with-regex=system' '--with-xml' '--with-expat-dir=/usr' '--with-dom=shared,/usr' '--with-dom-xslt=/usr' '--with-dom-exslt=/usr' '--with-xmlrpc=shared' '--with-zlib' '--enable-bcmath' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-discard-path' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--enable-soap' '--with-snmp=shared' '--without-oci8' '--with-kerberos' '--with-ldap=shared' '--with-mysql=shared' '--with-pgsql=shared' '--enable-memory-limit' '--enable-bcmath' '--enable-shmop' '--enable-calendar' '--enable-dbx' '--enable-dio' '--enable-mcal' '--enable-mbstring=shared' '--enable-mbstr-enc-trans' '--enable-mbregex' '--with-pic' '--enable-force-cgi-redirect' '--enable-fastcgi'


Also, it lists the 'extension_dir' as '/usr/local/php5/lib/php/extensions/no-debug-non-zts-20050922' even though I have changed it in my php5.ini files.

Obviously, I am missing something........

Thanks!

Luke
Catalyst
Have you added `extension=mysql.so` to php5.ini?

I had this problem with 5.1.1 --- POS. I ended up fixing it with the following config line:
CODE
'./configure'

'--host=i686-pc-linux-gnu'

'--build=i686-pc-linux-gnu'

'--target=i386-redhat-linux-gnu'

'--prefix=/usr/local/php5'

'--cache-file=config.cache'

'--with-config-file-path=/usr/local/php5/etc'

'--with-config-file-scan-dir=/usr/local/php5/etc/php.d'

'--enable-force-cgi-redirect'

'--disable-debug'

'--enable-pic'

'--disable-rpath'

'--enable-inline-optimization'

'--with-bz2'

'--with-db4=/usr'

'--with-curl'

'--with-freetype-dir=/usr'

'--with-png-dir=/usr'

'--with-gd'

'--enable-gd-native-ttf'

'--without-gdbm'

'--with-gettext'

'--with-ncurses'

'--with-gmp'

'--with-iconv'

'--with-jpeg-dir=/usr'

'--with-ssl'

'--with-mime_magic'

'--with-openssl=/usr'

'--with-png'

'--with-pspell=/usr'

'--with-regex=system'

'--with-xml'

'--with-expat-dir=/usr'

'--with-dom=shared,/usr'

'--with-dom-xslt=/usr'

'--with-dom-exslt=/usr'

'--with-xmlrpc=shared'

'--with-pcre-regex=/usr'

'--with-zlib'

'--enable-bcmath'

'--enable-ctype'

'--enable-exif'

'--enable-ftp'

'--enable-magic-quotes'

'--enable-pcntl'

'--enable-sockets'

'--enable-sysvsem'

'--enable-sysvshm'

'--enable-discard-path'

'--enable-track-vars'

'--enable-trans-sid'

'--enable-yp'

'--enable-wddx'

'--without-oci8'

'--with-imap=shared'

'--with-imap-ssl'

'--with-kerberos'

'--with-ldap=shared'

'--with-mysql=shared'

'--with-pgsql=shared'

'--with-unixODBC=shared,/usr'

'--enable-memory-limit'

'--enable-bcmath'

'--enable-shmop'

'--enable-calendar'

'--enable-dbx'

'--enable-dio'

'--enable-mcal'

'--enable-mbstring=shared'

'--enable-mbstr-enc-trans'

'--enable-mbregex'

'--with-pic'

'--enable-force-cgi-redirect'

'--enable-fastcgi'

'--without-pear'
Note that this way, the php.ini is in /usr/local/php5/etc, and you'll need a /usr/local/php5/etc/php.d directory with a few more files to help load the shared modules.
CODE
imap.ini:
; Enable imap extension module

extension=imap.so



ldap.ini:
; Enable ldap extension module

extension=ldap.so



mbstring.ini:
; Enable mbstring extension module

extension=mbstring.so



mysql.ini:
; Enable mysql extension module

extension=mysql.so



odbc.ini:
; Enable odbc extension module

extension=odbc.so



pgsql.ini:
; Enable pgsql extension module

extension=pgsql.so



snmp.ini:
; Enable snmp extension module

extension=snmp.so



xmlrpc.ini:
; Enable xmlrpc extension module

extension=xmlrpc.so
Gotta do it without PEAR, otherwise it'll overwrite /usr/share/pear where 5.0.5 didn't.
luke_s
Nice. that worked well. I was using 5.1.1 as well.

your input is MUCH appreciated.

Luke
luke_s
Hey all,

I can't seem to get the session.save_path to set to /tmp using this setup. I have set it to /tmp in the php5.ini files, reloaded - nothing.

Anyone else have this issue?
luke_s
Just a quick note to others who follow this how-to:

First, it is an excellent example of simple, but brilliant ideas that are very effective.

Second, there are two slightly different methods described here (both very helpful). So, keep an eye on the differences. My issue with the session.save_path had to do with the fact that I had been naming the .ini file 'php5.ini' and then needed to revert to php.ini in a new location as I moved from one method to another.

So, renaming my .ini file located in /usr/local/php5/etc/ from 'php5.ini' to 'php.ini' solved that issue. Of course, I should have seen this change clearly, but sometimes it's those little alterations that get past you! icon_biggrin.gif

Luke
Catalyst
QUOTE (luke_s)
So, renaming my .ini file located in /usr/local/php5/etc/ from 'php5.ini' to 'php.ini' solved that issue. Of course, I should have seen this change clearly, but sometimes it's those little alterations that get past you! icon_biggrin.gif
Doh! I actually did that, too, when I was working out what needed to change from the 5.0.5 to the 5.1.1 install.

For the benefit of other who might wanna try this: Certainly, there's broken stuff in 5.1.1, so it shouldn't be used for anything more than a test platform --- bugs that are both numerous and exclusive, with neither rhyme nor reason. So, brave knights, if you do doubt your courage or your strength, come no further, for death awaits you all with nasty, big, pointy teeth. I'd suggest you stick with 5.0.5.
troyoz
Have tryed most of the config scripts but seem to get a continual error of
configure: error: Please reinstall the libcurl distribution -
easy.h should be in /include/curl/
Curl is installed but it maybe due to system being CentOS on Ensim 4.1
Any help will greatly be appreciated
mta
I haven't tried this on CentOS yet, but try installing the curl-devel rpm.
ie.
yum install curl-devel
Catalyst
*nod* That's 99% of the configure & compile errors right there --- You'll need devel packages for just about every option listed.
troyoz
okay that part is solved but now I have another please
configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path
Catalyst
I hate to ask a stupid question, but do you have postregsql-devel installed? Supposed to be in /usr/include/libpq-fe.h, and it's installed with postgresql-devel. That's the only place the configure will look unless you specify a different shared-dir.
troyoz
I just tried the script that Catalyst put here but still an error with CentOS
configure: error: Cannot find rfc822.h. Please check your c-client installation.
troyoz
Thanks to all of you for terrific support regarding this issue. I have removed the following lines from script
> '--with-imap=shared'
> '--with-imap-ssl'
and was able to completely compile but am concerned that if I leave these out it will cause me other issues. If someone could please help as to what rpms I should install for above it will be greatly appreciated.
Once I compile what is my further instructions so I do not overright exsisting php version. Just mak, then make install?
Catalyst
Install libc-client-2002e-14 and that'll get rid of the error. They bugged it up with 5.1.1. ;-)

Well, using that configure script you're keeping it all in /usr/local/php5. The --without-pear is important, because no matter how you do it, it'll attempt to overwrite /usr/share/pear with newer (and incompatible) PEAR libraries. But that's it --- the second listed has the /usr/local/php5/etc/php.ini & php.d so you eliminate the risk of overwriting anything you need.
Saesch
Hello everyone

I tried to install php4 + php5 with the above instructions (excpet that I try to install 5.1.2). So far so good but when I try to parse a php5 file it tells me in the Apache error_log:

CODE
[Fri Dec 09 22:46:02 2005] [error] [client 70.XX.XX.19] /usr/local/php5/bin/php: relocation error: /usr/local/php5/bin/php: undefined symbol: xmlParserInputBufferCreateFilenameDefault

[Fri Dec 09 22:46:02 2005] [error] [client 70.XX.XX.19] Premature end of script headers: php5-script


I seems to have something to do with the libxml2 installation but I think I have the most recent rpm's installed (or are there newer ones?):

libxml2-devel-2.6.16-1.1.fc1.rf.i386.rpm
libxml2-2.6.16-1.1.fc1.rf.i386.rpm

My system is a Ensim 4.0.3 on Fedora Core 1.

Anyone has a idea?
Catalyst
Did you install those before or after you compiled PHP? You've got the latest, by http://dag.wieers.com/packages/libxml2/.
Saesch
Before. When I try to install them it says me that they are already installed. Is it possible, that the libxml2 version 2.6.16 isnt compatible with PHP 5.1.2 and i need a newer one?
Catalyst
If so, you should have had a compile-time warning. I'd say remove it, re-install and try config.nice again. Just watch your errors and warnings.

I haven't tried to compile 5.1.2, so it's just a guess. I've given up on the 5.1.x branch completely.
Saesch
QUOTE (Catalyst)
If so, you should have had a compile-time warning. I'd say remove it, re-install and try config.nice again. Just watch your errors and warnings.
 
I haven't tried to compile 5.1.2, so it's just a guess.  I've given up on the 5.1.x branch completely.


Thanks. Ill give it a try.

Are you using the 5.0.x branch instead? If so, what are the security implications of this decision? I had always the feeling that not using the most recent PHP is a security risk?!
Catalyst
You need to read the release notes, rather than just thinking, "new version --- let's grab it!" ;-)

5.0.5 was the last stable branch of 5.0, which had quite a few incompatibilities with old code as it stands. 5.1.x is a new branch --- new features, and still under heavy development. Thus far, it's broken a _lot_ more backwards compatibility, especially with objects passed by reference. It won't be fixed in the forseeable future, either --- the dev team have made that abundantly clear.
Saesch
Thanks for your help catalyst, it worked with the 5.05 version.

Now I have another problem:

When I try to connect MySQL it tells me:
CODE
Fatal error: Call to undefined function mysql_pconnect() in /var/www/html/includes/DatabaseConnection_inc.php on line 42


@catalyst: I tried your solution with the php.d directory.
1. I made the configure with:
CODE
--with-config-file-scan-dir=/usr/local/php5/etc/php.d

2. Inserted the following into php5.ini:
CODE
mysql.ini:
; Enable mysql extension module

extension=mysql.so

3. I copied a mysql.so File to the php.d Directory. The file was from:
CODE
/usr/local/php5/lib/php/extensions/no-debug-non-zts-20050922/mysql.so


But I have still the "call to undefined function". Did I something wrong?

My MySQL Version is: 4.0.22. Is that version too low for PHP5?

Thanks for your help...
Saesch
Everything is working now.

It was a problem with the parsing of the php.ini file.
mta
Has anyone succeeded in putting this into Ensim's virtual filesystem template?
I've got it to install php 5 to /usr/local/php5 by default by creating a rpm and adding it to /etc/virtualhosting/filelists/apache.custom.sh, but I can't seem to get it to copy the interpreter script over. I've added the line /var/www/interpreters/php5-script to apache.pkgtemplates.list and apache.templates.list and created the file php5-script in /etc/virtualhosting/templates/apache/var/www/interpreters where the others reside, but it doesn't pick it up. Any suggestions?
Catalyst
QUOTE (mta)
Has anyone succeeded in putting this into Ensim's virtual filesystem template?
I've got it to install php 5 to /usr/local/php5 by default by creating a rpm and adding it to /etc/virtualhosting/filelists/custom.sh, but I can't seem to get it to copy the interpreter script over. I've added the line /var/www/interpreters/php5-script to apache.pkgtemplates.list and apache.templates.list and created the file php5-script in /etc/virtualhosting/templates/apache/var/www/interpreters where the others reside, but it doesn't pick it up. Any suggestions?
If you have it working by manually copying the directory, and you create an RPM called "php5-ensim" or something along that line, then just add it to /etc/virtualhosting/filelists/apache.custom.sh the same way as audit-libs and php-pear. Just make sure the RPM encompases the whole of /usr/local/php5, and you should be okay.
mta
Sorry, I should have been more clear. I have created a php 5 rpm containing /usr/local/php5, and added it to apache.custom.sh... Ensim has picked that up fine.

What I am having trouble with is adding the file /var/www/interpreters/php5-script for each virtual site. I did not include this file in the rpm, as it needs to be owned by the site admin, and I was hoping to have it added in the same way that /var/www/interpreters/php-script is added. Refer to my previous post for the details. Any ideas on this?
swissmonk
This is how I did it:

1. Create a php5.sh file in /etc/appliance/customization/

cat </home/virtual/$2/fst/var/www/interpreters/php5-script
#!/bin/bash
export SCRIPT_NAME=${PATH_TRANSLATED##${DOCUMENT_ROOT}}
export SCRIPT_FILENAME=$PATH_TRANSLATED
/usr/local/php5/bin/php
EOF

chown $4:$4 /home/virtual/$2/fst/var/www/interpreters/php5-script
chmod 710 /home/virtual/$2/fst/var/www/interpreters/php5-script

cat </etc/httpd/conf/$2/php5
Action php5-script /interpreters/php5-script
AddHandler php5-script .php5
EOF

2. Modify virtDomain.sh to run this script:
IP=`cat /etc/virtualhosting/namebased_ip_addrs`
DOMAIN=$1
WP_USER=`/usr/local/bin/sitelookup -d $DOMAIN wp_user`
SITE=`cat /etc/virtualhosting/mappings/domainmap | grep -w "$1" | cut -f2 -d'='`
/etc/appliance/customization/php5.sh $DOMAIN $SITE $IP $WP_USER

Warning with this, there is also a security risk when you do only that, as php5 is not interpreted in site preview (http://www.server.com/domain.com/page.php5), you will see the php code of the site.

To fix this I have added a line on php5.sh
/usr/bin/perl -i -p -e 's/AddHandler php-script .php .php4 .php3/AddHandler php-script .php .php5 .php4 .php3n/' /etc/httpd/conf/virtual.preview/$2

You will also have to create another script it in editVirtDomain.sh as the modification of the file in virtual.preview will be overwritten when somebody modify the site.

Sebastien
mta
Thanks for the reply, and for including the details. I had thought about going that route, but was hoping that someone knew of a way using the filesystem templates etc. I will most likely give up on that and go with the method you outlined here.
Catalyst
Exactly what I was gonna suggest. That's the only way I can think to do it while retaining proper ownership, too. ;-)
fbnewtz
Ok I think I have 5.1.4 installed right now on a fresh ensim 4.1.0-8 box. I don't even have any domains setup on there yet. My question is this:

I have followed SwissMonks advice and created the PHP5 and the virtDomain.sh files in the /etc/appliance/customization folder and wanted to make sure that is all I have to do to get it to install into each new domain that gets added.

Do I have to create a RPM file as stated previously by MTA? If so how do I do that? Do I have to create a RPM script or can I just do rpm -bb /usr/local/php5 or something?

The box did not come with any of the devel packages loaded. Do I need unixODBC and if so how can I install it properly?

Thanks,

Fred
mta
You will need to create a PHP 5 rpm if you want to use Ensim's filelists .sh method of automatically installing it to the virtual sites. Do a Google search for 'RPM howto' and you will find information on creating your own spec files. You may also want to use the php5.spec provided with the source tarball, or even the spec file from your Linux distribution's source RPM of PHP 4 as a guide to start from. About unixodbc, just fetch the devel rpm using yum or up2date, whichever your preference. The package should be named 'unixODBC-devel' ( that's case sensitive ).
fbnewtz
Darn. I had it all working and all the sudden it no longer wants to play friendly. I don't know what happened and now neither 4 or 5 works. I keep getting the Internal Server Error.

[Tue May 09 21:46:29 2006] [error] [client 72.177.253.50] Premature end of script headers: php5-script
[Tue May 09 21:46:32 2006] [error] [client 72.177.253.50] Premature end of script headers: php5-script
[Tue May 09 21:46:34 2006] [error] [client 72.177.253.50] Premature end of script headers: php-script
[Tue May 09 21:49:18 2006] [error] [client 72.177.253.50] Premature end of script headers: php5-script
[Tue May 09 21:55:31 2006] [error] [client 72.177.253.50] Premature end of script headers: php5-script
[Tue May 09 21:58:40 2006] [error] [client 72.177.253.50] Premature end of script headers: php5-script
[Tue May 09 22:09:11 2006] [error] [client 72.177.253.50] Premature end of script headers: php5-script
[Tue May 09 22:09:16 2006] [error] [client 72.177.253.50] Premature end of script headers: php5-script
[Tue May 09 22:09:19 2006] [error] [client 72.177.253.50] Premature end of script headers: php-script
[Tue May 09 22:13:19 2006] [error] [client 72.177.253.50] Premature end of script headers: php5-script

Is the only thing that shows up in my error_log. I am just simply doing the following on a single line in my test.php file:



The site is site1 and the files are all owned by admin1:admin1. The file has the following permissions: -rw-r--r--.

I did install ruby and tried to install rails today, but otherwise I have not changed my configuration. I have even reveresed all of the changes I made with the ruby and rails configuration. Nothing I have done in the ruby install has changed anything in my apache installation minus the changes I made personally and by adding files into the shared configuration.

Thanks,

Fred
mta
You've probably already done this, but be sure that /home/virtual/siteXX/fst/var/www/interpreters/php5-script is owned by the site admin and contains the correct path to the PHP 5 binary.
propcgamer
QUOTE (mta)
You've probably already done this, but be sure that /home/virtual/siteXX/fst/var/www/interpreters/php5-script is owned by the site admin and contains the correct path to the PHP 5 binary.


i am having the same issue with premature headers, the script is owned by the site admin and contains the correct path

i tired running a script using the path in command line, and it worked perfectly.

i also tried modifying the php-script, and it doesnt work
UH-Matt
So i have got all this working nicely (testing by manually copying things and such) and have built php5 rpm's but when trying to add the following to apache.custom.sh I get below error:

echo "S,rpm:php5"
echo "S,rpm:php5-pdo"
echo "S,rpm:php5-imap"
echo "S,rpm:php5-ncurses"
echo "S,rpm:php5-soap"
echo "S,rpm:php5-bcmath"
echo "S,rpm:php5-devel"
echo "S,rpm:php5-ldap"
echo "S,rpm:php5-mysql"
echo "S,rpm:php5-odbc"
echo "S,rpm:php5-snmp"
echo "S,rpm:php5-xml"
echo "S,rpm:php5-common"
echo "S,rpm:php5-dba"
echo "S,rpm:php5-mbstring"
echo "S,rpm:php5-pgsql"
echo "S,rpm:php5-xmlrpc"


Oct 1 10:32:28 dedicated [31247]: - (ERROR: 01ff00000000006a): Traceback occurred: exceptions.KeyError Traceback (most recent call last): File "/home/build/qa/saber/10.2.0/rhel.4ES/rhel.4ES.5/epl/skathalkar5/WebGui/scripts/maintenance/wp/UpgradeActiveVirtDomains.py", line 948, in ? File "/home/build/qa/saber/10.2.0/rhel.4ES/rhel.4ES.5/epl/skathalkar5/WebGui/scripts/maintenance/wp/UpgradeActiveVirtDomains.py", line 432, in update_fst KeyError: 'php5'

Any ideas?
mta
Matt, have you first installed your custom rpms at the OS level?
UH-Matt
QUOTE (mta @ Oct 1 2007, 06:05 PM) *
Matt, have you first installed your custom rpms at the OS level?


Yes:

[root@dedicated ~]# rpm -qa | grep -i ^php5
php5-5.2.4-1.1.rhel4.ct
php5-devel-5.2.4-1.1.rhel4.ct
php5-mysql-5.2.4-1.1.rhel4.ct
php5-snmp-5.2.4-1.1.rhel4.ct
php5-common-5.2.4-1.1.rhel4.ct
php5-pdo-5.2.4-1.1.rhel4.ct
php5-dba-5.2.4-1.1.rhel4.ct
php5-imap-5.2.4-1.1.rhel4.ct
php5-mbstring-5.2.4-1.1.rhel4.ct
php5-ncurses-5.2.4-1.1.rhel4.ct
php5-pgsql-5.2.4-1.1.rhel4.ct
php5-soap-5.2.4-1.1.rhel4.ct
php5-xmlrpc-5.2.4-1.1.rhel4.ct
php5-bcmath-5.2.4-1.1.rhel4.ct
php5-ldap-5.2.4-1.1.rhel4.ct
php5-odbc-5.2.4-1.1.rhel4.ct
php5-xml-5.2.4-1.1.rhel4.ct
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.