View Full Version : PHP5 CGI & CLI with an existing PHP4 Modules installation
pascal
10-01-2006, 12:33 PM
************************************************** *********************
* EDITED : New SRPM version for php5.2.0 *
* Download it (http://clust01-carat01.carat-hosting.com/srpm/php5-5.2.0-CLI_CGI.rhe4x.1.0.2.src.rpm) *
* See http://www.interworx.com/forums/showpost.php?p=10804&postcount=5 *
************************************************** *********************
Hello,
I've changed the existing php-5.1.2-iworx srpm to allow the rpm to be installed on a box with php4 already installed as a module.
The rpm will install both cgi and cli version
Bin are in /usr/bin/php5.2.0
lrwxrwxrwx 1 root root 7 Oct 1 15:42 php -> php-cgi
-r-x--x--x 1 root root 4723472 Oct 1 15:28 php-cgi
-r-x--x--x 1 root root 18004654 Oct 1 15:28 php-cli
Ini files are in /etc/php5/
-rw-r--r-- 1 root root 39517 Oct 1 15:28 php-cgi.ini
-rw-r--r-- 1 root root 39517 Oct 1 15:28 php-cli.ini
drwxr-xr-x 2 root root 4096 Oct 1 19:01 php.d
Extension are in /usr/lib/php5
mysql.so
etcx...
IT WORKS FOR US, BUT IT öIGHT NOT FOR YOU. WE WON'T ASSUME ANY BROKS IN YOUR SYSTEM. CHECK THE SPEC FILE IF YOU ARE NOT SURE.
The php5.2.0 SRPM
http://clust01-carat01.carat-hosting.com/srpm/php5-5.2.0-CLI_CGI.rhe4x.1.0.2.src.rpm
Rebuild the SRPM will also install all these RPMS-
-rw-r--r-- 1 root root 548858 Oct 1 18:50 php-devel-5.2.0-cli_cgi.rhe4x.1.0.2.x86_64.rpm
-rw-r--r-- 1 root root 41051 Oct 1 18:50 php-imap-5.2.0-cli_cgi.rhe4x.1.0.2.x86_64.rpm
-rw-r--r-- 1 root root 22865 Oct 1 18:50 php-ldap-5.2.0-cli_cgi.rhe4x.1.0.2.x86_64.rpm
-rw-r--r-- 1 root root 1018842 Oct 1 18:50 php-mbstring-5.2.0-cli_cgi.rhe4x.1.0.2.x86_64.rpm
-rw-r--r-- 1 root root 17406 Oct 1 18:50 php-mcrypt-5.2.0-cli_cgi.rhe4x.1.0.2.x86_64.rpm
-rw-r--r-- 1 root root 7710 Oct 1 18:50 php-mhash-5.2.0-cli_cgi.rhe4x.1.0.2.x86_64.rpm
-rw-r--r-- 1 root root 26098 Oct 1 18:50 php-mysql-5.2.0-cli_cgi.rhe4x.1.0.2.x86_64.rpm
-rw-r--r-- 1 root root 30459 Oct 1 18:50 php-ncurses-5.2.0-cli_cgi.rhe4x.1.0.2.x86_64.rpm
-rw-r--r-- 1 root root 31546 Oct 1 18:50 php-odbc-5.2.0-cli_cgi.rhe4x.1.0.2.x86_64.rpm
-rw-r--r-- 1 root root 2420 Oct 1 18:50 php-pear-5.2.0-cli_cgi.rhe4x.1.0.2.x86_64.rpm
-rw-r--r-- 1 root root 45891 Oct 1 18:50 php-pgsql-5.2.0-cli_cgi.rhe4x.1.0.2.x86_64.rpm
-rw-r--r-- 1 root root 14905 Oct 1 18:50 php-snmp-5.2.0-cli_cgi.rhe4x.1.0.2.x86_64.rpm
-rw-r--r-- 1 root root 44595 Oct 1 18:50 php-xmlrpc-5.2.0-cli_cgi.rhe4x.1.0.2.x86_64.rpm
To install the RPM do :
1- Download it
wget http://clust01-carat01.carat-hosting.com/srpm/php5-5.2.0-CLI_CGI.rhe4x.1.0.2.src.rpm
2- Rebuild it
rpmbuild --rebuild --with<yourarch> php-5.2.0-cli_cgi.rhe4x.1.0.3.src.rpm
Your arch mightr be
rht90
cos3x
fdr10
fdr20
fdr30
fdr40
whb3x
rhe2x
rhe3x
rhe4x (also for cos4x)
3- Install it
rpm -ivh /usr/src/redhat/RPMS/i386 ou x86_64/php-5.2.0-cli_cgi.rhe4x.1.0.2.rpm
If you want ot give to your users the ability to use PHP5 as CGI just update their vhost conf file or create an .htaccess file with something like this:
AddHandler x-httpd-php5 .php5
Action x-httpd-php5 /php5/php-cgi
ScriptAlias /php5/ /home/account/domaine/html/php5/
in the docroot of the user create a dir named php5 and copy in it the /usr/bin/php5.2.0/php-cgi
Chnage the owner of this file to allow suexec
Here is the reslult of phpinfo.php5 file in the php5 dir
http://clust01-carat01.carat-hosting.com/phpinfo.php5
Hope it helps some of you
Pascal
----------------
Carat Hosting : Hébergement de sites Internet (http://www.carat-hosting.com)
pascal
10-01-2006, 01:32 PM
ps : after rebuild process you^ll also have others rpms available to install depending on which extensions you'd like to install with php5
php-5.1.2-cli_cgi.rhe4x.1.0.3.x86_64.rpm php-mysql-5.1.2-cli_cgi.rhe4x.1.0.3.x86_64.rpm
php-devel-5.1.2-cli_cgi.rhe4x.1.0.3.x86_64.rpm php-ncurses-5.1.2-cli_cgi.rhe4x.1.0.3.x86_64.rpm
php-imap-5.1.2-cli_cgi.rhe4x.1.0.3.x86_64.rpm php-odbc-5.1.2-cli_cgi.rhe4x.1.0.3.x86_64.rpm
php-ldap-5.1.2-cli_cgi.rhe4x.1.0.3.x86_64.rpm php-pear-5.1.2-cli_cgi.rhe4x.1.0.3.x86_64.rpm
php-mbstring-5.1.2-cli_cgi.rhe4x.1.0.3.x86_64.rpm php-pgsql-5.1.2-cli_cgi.rhe4x.1.0.3.x86_64.rpm
php-mcrypt-5.1.2-cli_cgi.rhe4x.1.0.3.x86_64.rpm php-snmp-5.1.2-cli_cgi.rhe4x.1.0.3.x86_64.rpm
php-mhash-5.1.2-cli_cgi.rhe4x.1.0.3.x86_64.rpm php-xmlrpc-5.1.2-cli_cgi.rhe4x.1.0.3.x86_64.rpm
Pascal
----------------
Carat Hosting : Hébergement de sites Internet (http://www.carat-hosting.com)
pascal
10-23-2006, 10:29 AM
More information to have this RPM PHP5 isntalled with suPHP here
http://interworx.com/forums/showpost.php?p=10251&postcount=3
pascal
12-10-2006, 07:20 AM
UPDATES :
Here is the SRPM for the php5.2.0 Version. http://clust01-carat01.carat-hosting.com/srpm/php5-5.2.0-CLI_CGI.rhe4x.1.0.2.src.rpm
Binaries are installed in /usr/bin/php5.2.0/
Here is a phpinfo of php5.2.0 http://clust01-carat01.carat-hosting.com/phpinfo.php5
Here is a phpinfo of php4 installed on the same box http://clust01-carat01.carat-hosting.com/phpinfo.php
Pascal
----------------
Carat Hosting : Hébergement de sites Internet (http://www.carat-hosting.com)
sinopeach
02-04-2007, 11:36 PM
G'Day Pascal,
I am salivating at the thought of using your SRPM's - but none of your links resolve from China, HK or Australia? :-\
Cheers,
RF.
pascal
02-05-2007, 01:59 AM
Arff sorry
Here is the link : http://clust01-carat01.carat-hosting.com/srpm/
Pascal
sinopeach
02-07-2007, 10:06 PM
Actually,
Do you still have the 5.1.6 src rpm handy?
Drupal for one doesn't like 5.2. :-(
Cheers,
RF.
sinopeach
02-07-2007, 11:19 PM
Actually the 5.0.4 is the best version as that is what is in centos plus.....
pascal
02-08-2007, 02:18 AM
Actually,
Do you still have the 5.1.6 src rpm handy?
Drupal for one doesn't like 5.2. :-(
Cheers,
RF.
What you can do is
- donwload our php5.2 src.rpm
- find and download a php5.1.6.tar.gz
- Install the src.rpm
rpm -ivh /your/path/php5-5.2.0...src.rpm
- Copy the php5.1.6.tar.gz in the /usr/src/redhat/SOURCES/ directory
- Change the php5.spec file in /usr/src/redhat/SPEC/
vi /usr/src/redhat/SPEC/php.spec
- update the second line and enter 5.1.6 rather than 5.2.0
%define pversion 5.1.6
- Rebuild the rpm
cd /usr/src/redhat/SPEC/
rpmbuild -ba --with rhe4x ./php5.spec
If everything goes well it will create all php5 and php5 modules rpms in /usr/src/redhat/RPMS/yourdistro/
And the src.rpm in /usr/src/redhat/SRPMS/
Hope this help
Pascal
sinopeach
02-09-2007, 09:25 AM
Ok going to give it a try - I guess it is just reuisng your .spec/makefile ? Which is really where your magic has come from? ;-)
01byte
02-13-2007, 10:30 AM
very informative post...thanks buddy...
sinopeach
02-14-2007, 12:48 AM
Ok - got it to compile and work - needed to repackage the .tar.gz to place in a php5 directory instead of php to get the rpmbuild to work.
All works OK test.candishosting.com.cn/test.php but I can't seem to get the mysql module to load and work (rpm is installed) - mysqli appears fine though.
I noticed in the shell a:
/chroot/usr/lib/php4/mysql.so
So I made a:
/chroot/usr/lib/php5/ directory and then:
cp /usr/lib/php5/mysql.so /chroot/usr/lib/php5/
But still no luck. There are numerous /etc/php.ini /etc/php.d /etc/php5 /etcphp5/php.d and /etc/php-cli.ini files... all have mysql correcyty defined....
What am I missing?
Cheers,
RF.
sinopeach
02-14-2007, 12:57 AM
I ran php5 manually and got this:
[root@www-d01 php.d]# cd /usr/bin/
[root@www-d01 bin]# ./php5 -m
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/imap.so' - /usr/lib/php/modules/imap.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/ldap.so' - /usr/lib/php/modules/ldap.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/mbstring.so' - /usr/lib/php/modules/mbstring.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/mcrypt.so' - /usr/lib/php/modules/mcrypt.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/mhash.so' - /usr/lib/php/modules/mhash.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules//usr/lib/php5/mysql.so' - /usr/lib/php/modules//usr/lib/php5/mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/ncurses.so' - /usr/lib/php/modules/ncurses.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/odbc.so' - /usr/lib/php/modules/odbc.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/xmlrpc.so' - /usr/lib/php/modules/xmlrpc.so: cannot open shared object file: No such file or directory in Unknown on line 0
[PHP Modules]
bcmath
bz2
calendar
ctype
curl
date
dba
dom
exif
ftp
gd
gettext
gmp
hash
iconv
libxml
mysqli
openssl
pcre
PDO
pdo_mysql
pdo_pgsql
posix
readline
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
SQLite
standard
sysvsem
sysvshm
tokenizer
xml
xmlreader
xmlwriter
xsl
zlib
[Zend Modules]
sinopeach
02-14-2007, 01:28 AM
It seems that the php5 modules all can't be loaded - mbstring, mysql, etc....
What needs to be changed in the specfile/rpmbuild process to correct this... And yes ALL the new rpms for these modules WERE installed! ;-)
sinopeach
02-14-2007, 01:37 AM
I mean, the support rpms were all made and install fine (ivh) however there is something wrong in a config file somewhere... ?
sinopeach
02-15-2007, 07:42 AM
I just put the carat hosting 5.2 php back in and the results are the same. So there is a definate issue with this approach to use PHP5.x.x with iworx...
[root@www-d01 i386]# /usr/bin/php5 -m
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/imap.so' - /usr/lib/php/modules/imap.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/ldap.so' - /usr/lib/php/modules/ldap.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/mbstring.so' - /usr/lib/php/modules/mbstring.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/mcrypt.so' - /usr/lib/php/modules/mcrypt.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/mhash.so' - /usr/lib/php/modules/mhash.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/mysql.so' - /usr/lib/php/modules/mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/ncurses.so' - /usr/lib/php/modules/ncurses.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/odbc.so' - /usr/lib/php/modules/odbc.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/pgsql.so' - /usr/lib/php/modules/pgsql.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/snmp.so' - /usr/lib/php/modules/snmp.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/xmlrpc.so' - /usr/lib/php/modules/xmlrpc.so: cannot open shared object file: No such file or directory in Unknown on line 0
[PHP Modules]
bcmath
bz2
calendar
ctype
curl
date
dba
dom
exif
filter
ftp
gd
gettext
gmp
hash
iconv
json
libxml
mysqli
openssl
pcre
PDO
pdo_mysql
pdo_pgsql
pdo_sqlite
posix
readline
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
SQLite
standard
sysvsem
sysvshm
tokenizer
xml
xmlreader
xmlwriter
xsl
zlib
[Zend Modules]
[root@www-d01 i386]#
IWorx-Socheat
02-15-2007, 09:14 AM
Look in /usr/lib/php5 and see if the modules are installed there. If so, then, look in /etc/php.ini and make sure the extension_dir= matches.
Socheat
pascal
02-15-2007, 05:20 PM
I just put the carat hosting 5.2 php back in and the results are the same. So there is a definate issue with this approach to use PHP5.x.x with iworx...
I use iworx and PHP5.2.0/PHP4.4.4 and suPHP, all works well together
Do you have a x86_64 box or i386 ?
This rpm is created to ONLY install the CLI and CGI version of PHP5. The sapi won't be installed. So basicly this rpm and src.rpm has been created to install PHP5 on a box already running PHP4
For this reason all files are going in a php5 directory rather than php (which is used for PHP4 install)
So if you have a i386 box.
Look in /usr/lib/php5/ directory. You should have all your installed module there
drwxr-xr-x 2 root root 4096 fév 5 11:14 build
-rwxr-xr-x 1 root root 1946046 fév 5 11:11 mbstring.so
-rwxr-xr-x 1 root root 63141 fév 5 11:11 mysql.so
-rwxr-xr-x 1 root root 398763 déc 12 13:44 pdf.so
Also as Socheat told you, look in /etc/php5/php.ini and verify that extension_dir= matches.
I have this, because lmy box is a 64 bits,
extension_dir = "/usr/lib64/php5"
if yours is a 32Bits then you should have
extension_dir = "/usr/lib/php5"
Pascal
pascal
02-15-2007, 05:30 PM
I ran php5 manually and got this:
[root@www-d01 php.d]# cd /usr/bin/
[root@www-d01 bin]# ./php5 -m
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/imap.so' - /usr/lib/php/modules/imap.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/ldap.so' - /usr/lib/php/modules/ldap.so: cannot open shared object file: No such file or directory in Unknown on line 0
What is the binary php5 ?
could you please provide
ls -l /usr/bin/php5
It looks like you don't use the binary installed by our rpm. Indeed, the rpm install all php5 modules in /usr/lib(64)/php5
Pascal
sinopeach
02-18-2007, 10:17 PM
I put back your 5.2 and this is the ls output:
[root@www-d01 php5]# ls -l /usr/lib/php5/
total 2400
drwxr-xr-x 2 root root 4096 Feb 15 21:40 build
-rwxr-xr-x 1 root root 104884 Feb 7 18:39 imap.so
-rwxr-xr-x 1 root root 47458 Feb 7 18:39 ldap.so
-rwxr-xr-x 1 root root 1763329 Feb 7 18:39 mbstring.so
-rwxr-xr-x 1 root root 38219 Feb 7 18:39 mcrypt.so
-rwxr-xr-x 1 root root 9976 Feb 7 18:39 mhash.so
-rwxr-xr-x 1 root root 54186 Feb 7 18:39 mysql.so
-rwxr-xr-x 1 root root 83754 Feb 7 18:39 ncurses.so
-rwxr-xr-x 1 root root 68391 Feb 7 18:39 odbc.so
-rwxr-xr-x 1 root root 110485 Feb 7 18:39 pgsql.so
-rwxr-xr-x 1 root root 28254 Feb 7 18:39 snmp.so
-rwxr-xr-x 1 root root 94534 Feb 7 18:39 xmlrpc.so
[root@www-d01 php5]#
pascal
02-19-2007, 03:22 AM
Why do you install all these modules ? do you really need all of them ?
Ok so what is the content of the line "extension_dir= " in the file /etc/php5/php.ini ?
You must have this
extension_dir = "/usr/lib/php5"
Also could you please paste here the contents of this directory /etc/php5/php.d/
ls -l /etc/php5/php.d/
You must have an entry for all modules used, like for example
# ls -l /etc/php5/php.d/
total 12
-rw-r--r-- 1 root root 57 fév 5 11:11 mbstring.ini
-rw-r--r-- 1 root root 51 fév 5 11:11 mysql.ini
-rw-r--r-- 1 root root 43 déc 11 04:39 pdflib.ini
Could you please also show me the symlinks of /usr/bin/php5 ?
Please provide the result of
ls -l /usr/bin/php5
Pascal
sinopeach
02-19-2007, 09:50 PM
All working, it was the reference in /etc/php5/php.ini that was needed..
As to modules, apart from the normal, we need mbstring (china), mcrypt and mhash for some users, pgsql as it is the normal db that we use for real transactional applications cause at the end of the day mysql is just plain too lightweight, and snmp for a monitoring package we are testing the integration of with openmanage and Ubersmith...
pascal
02-20-2007, 07:28 AM
Well happy to know we have found and resolved your problems.
I was sure sure it should work :-p
So there is a definate issue with this approach to use PHP5.x.x with iworx...
And for the records, iworx doesn't have something to do with an installation of phpx/mysqlx/httpdx etc...
Interworx use his own php/mysql/httpd server, and so until you don't touch the interworx ones, you can install/hack/tweak what you want on your system
Pascal
daveyw
05-27-2007, 09:19 AM
Can you put the downloads online again, i wanna install php5, suphp nad php4.4.4 but i can't downloads are offline
pascal
05-27-2007, 09:35 AM
Can you put the downloads online again, i wanna install php5, suphp nad php4.4.4 but i can't downloads are offline
Sure.
http://clust01-carat01.carat-hosting.com/srpm/ is ok now
Pascal
WebXtrA
05-27-2007, 12:32 PM
would be nice if somebody creates *working* RPMs and provide a download location ;)
pascal
05-27-2007, 12:57 PM
would be nice if somebody creates *working* RPMs and provide a download location ;)
Yes but the RPM are OS specific, so you have to recreate the RPM from the SRPM depending of your OS
It's why I didn't put here the RPMS. Ours are CENTOS 4
Pascal
WebXtrA
05-27-2007, 04:22 PM
OK, that's true ;)
We only use Centos 4.x, I forgot that InterWorx also runs on other OSes.
WebXtrA
06-24-2007, 06:44 PM
This would be a very cool add-on for Iworx.
It would be nice to have a Package Option with PHP 4/PHP5/PHP 4 & 5 when you create a new siteworx account or edit it.
EverythingWeb
01-22-2008, 04:10 AM
We've succesfully installed this on FC3, FC4 & CentOS 4 servers, and it it's performing very well.
Pascal's links dont seem to be functioning at the moment, but we do have the SRPM's on our boxes, so if anyone does need them, I'm sure there wouldn't be objections for us to supply you a link.
Same goes for the suPHP SRPM :)
i am looking to run both php4 and php5 on my centos server is this the best way to go and does it work ok.
all the links for srpms appear to be down though.
thank you
EverythingWeb
03-11-2008, 03:19 PM
Please drop me a PM, and I'll let you have a link to them from our servers :)
Please drop me a PM, and I'll let you have a link to them from our servers :)
message sent
thank you
Few build dependencies missing which i have sorted
the only problem i have is when going to install command
error: Failed dependencies:
php5-pear is needed by php5-5.2.0-CLI_CGI.rhe4x.1.0.2.i386
thank you
EverythingWeb
03-12-2008, 02:10 PM
When you created the RPM's, didn't it create
php5-pear-5.2.0-CLI_CGI.rhe4x.1.0.2.i386.rpm
too?
The above RPM was built on a CentOS4.6 box.
yes it did sorted now thank you
it does not create the /usr/lib/php5 directory so i am missing the content of the folder.
tried 3 times now still the same.
any ideas how to fix this problem
Change the owner of this file to allow suexec
what do i change the owner to
thank you
netipro
03-17-2008, 06:47 AM
Hello
For your info we have used these SRPM (from iworx/carathosting) on our centos5 box and everythng was fine
PHP 4.4.4
http://www.netipro.com/downloads/php-4.4.4-100.rhe4x.iworx.src.rpm
PHP 5.2.0
http://www.netipro.com/downloads/php5-5.2.0-CLI_CGI.rhe4x.1.0.2.src.rpm
suPHP 0.6.2
http://www.netipro.com/downloads/suphp-0.6.2-100.cos5x.iworx.src.rpm
Pascal gave us these SRPMS
Then in /etc/httpd/conf.d/domain.conf we've added these lines
suPHP_Engine on
suPHP_UserGroup account account
suPHP_AddHandler x-httpd-php5 .php
suPHP_AddHandler x-httpd-php .php
suPHP_ConfigPath /etc/php5 (or cpy php.ini in /home/account/domain.com/ and define this path to allow the client to have his own php.ini)
SetEnv PHPRC /etc/php5/ (idem)
AddHandler x-httpd-php5 .php
AddHandler x-httpd-php5 .phtml
AcceptPathInfo On
here by default the php process will be done with PHP5 (it could be with php4)
Then we just have to create a .htaccess file in the directory we want php4 or php5 (it so allow to have a directory with php5 and an other with php4 under the same domain) and add these lines
AddHandler x-httpd-php .php .php4 .php3
or
AddHandler x-httpd-php5 .php .php5
Paul
Hello
For your info we have used these SRPM (from iworx/carathosting) on our centos5 box and everythng was fine
PHP 4.4.4
http://www.netipro.com/downloads/php-4.4.4-100.rhe4x.iworx.src.rpm
PHP 5.2.0
http://www.netipro.com/downloads/php5-5.2.0-CLI_CGI.rhe4x.1.0.2.src.rpm
suPHP 0.6.2
http://www.netipro.com/downloads/suphp-0.6.2-100.cos5x.iworx.src.rpm
Pascal gave us these SRPMS
Then in /etc/httpd/conf.d/domain.conf we've added these lines
here by default the php process will be done with PHP5 (it could be with php4)
Then we just have to create a .htaccess file in the directory we want php4 or php5 (it so allow to have a directory with php5 and an other with php4 under the same domain) and add these lines
Paul
Thank you
my main problem is that the /usr/lib/php5 and contents is not created for some reason every thing else seems to be there.
not sure why at present.
netipro
03-17-2008, 03:00 PM
Thank you
my main problem is that the /usr/lib/php5 and contents is not created for some reason every thing else seems to be there.
not sure why at present.
Did you try wth our SRPM ?
What is your OS ? 32 or 64 bits ?
Did you use the "with xxx" option when rebuilding the rpm ?
Did you have some errors when recreating the rpm ?
What rpms did you install (rpm -qa | grep php ) ? and how ?
If you give the SRPM I could check it to see where the pbm is
paul
netipro
03-17-2008, 03:18 PM
Thank you
my main problem is that the /usr/lib/php5 and contents is not created for some reason every thing else seems to be there.
not sure why at present.
So you should have ini files in /etc/php5/php.d/
for example if you do
rpm -ivh php5-mysql-5.2.0-CLI_CGI.rhe4x.1.0.2.i386.rpm you should have :
# ls /etc/php5/php.d/
mysql.ini
and
# ls /usr/lib/php5/
mysql.so
So what happens if you do for example
rpm -ivh /usr/src/redhat/RPMS/i386/php5-mbstring-5.2.0-CLI_CGI.rhe4x.1.0.2.i386.rpm
Paul
all working now, uninstalled all rpm and started again.
this time it created all the directory's including the modules that i had a problem with.
i have at the moment php4 as CGI and php5 as CGI/fastCGI can i have php4 as a module with php5 as CGI ?
at present php4 uses php file setup, if i want to setup php5 to use php and not have to have files ending php5.
what do i have to put in .htaccess ?
can php5 share ionCube setup for php4 or is that a seperate setup also.
Thanks for your help
netipro
03-20-2008, 07:19 AM
use suPHP
If you didn't change any vhost, then by default .php files is parsed by php4 module.
To use both php4 and php5 files under the same vhost you need suPHP
Look here
http://www.interworx.com/forums/showthread.php?t=1762 our posts 5,6,7,8
Everything is possible !
run php4 and php5 with .php files, run php4 with .php4 or php5 with .php5 etc !!!
Paul
netipro
03-20-2008, 07:27 AM
can php5 share ionCube setup for php4 or is that a seperate setup also.
php4 ini files are in /etc/php.ini and etc/php.d/
php5 ini files are in /etc/php5/php.ini and /etc/php5/php.d/
Using suPHP you can also define a php.ini file per domains.
So you can have ioncube for php4 and not php5 or php5 and not php4 or for both !
Also ioncube can just be added in the directory you need it !
So for example if you have in html/ all files parsed by php5 then you just have to put the corresponding ioncube loader, if you have, for example, a directory called html/app-php4/ which parse all php files with php4 then you just need to put there the ioncube loader for php4.4.4
etc...
With suphp you can define what you want !
just use :
suPHP_AddHandler and AddHandler in the vhost config file and in an htaccess file !
See this
http://www.interworx.com/forums/showpost.php?p=15211&postcount=5
and
http://www.interworx.com/forums/showpost.php?p=15213&postcount=7
and
http://www.interworx.com/forums/showpost.php?p=15214&postcount=8
Paul
vBulletin® v3.7.1, Copyright ©2000-2008, Jelsoft Enterprises Ltd.