Welcome! Log In Create A New Profile

Advanced

Nginx + PHP4 + PHP5 ??

Posted by help40 
Nginx + PHP4 + PHP5 ??
December 05, 2009 03:15PM
Hello,
I have already runing nginx + php5 php-fpm on my server , but I need php4 for some old old sites

how to setup php4 ? (can be done ??)

thank you in advance for help
Evgeny Petrenko
Re: Nginx + PHP4 + PHP5 ??
December 05, 2009 03:18PM
I think you need to compile and install php4 with all needed libs in a
separate directory. Then you have to run a php4 with php-fpm on a
separate port.

2009/12/5 help40 <nginx-forum@nginx.us>:
> Hello,
> I have already runing  nginx + php5 php-fpm  on my server ,  but I need  php4 for some old old sites
>
> how to setup php4 ?  (can be done ??)
>
> thank you in advance for help
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?3,28263,28263#msg-28263
>
>



--
With best regards, Evgeniy Petrenko.
Re: Nginx + PHP4 + PHP5 ??
December 06, 2009 11:33AM
Thank you for your fast reply and for directions you gave me

but I am not sure how I must configure / install php4 separate , so php5 keep running

something like adding

./configure --prefix=/usr/local/php4 --exec-prefix=/usr/local/php4 --program-suffix=4

when configure php4 ? but is it enough

any additional directions will be in favour

Regards, Alexiev
Juan Fco. Giordana
Re: Nginx + PHP4 + PHP5 ??
December 07, 2009 02:34AM
help40 wrote:
> Thank you for your fast reply and for directions you gave me
>
> but I am not sure how I must configure / install php4 separate , so php5 keep running
>
> something like adding
>
> ./configure --prefix=/usr/local/php4 --exec-prefix=/usr/local/php4 --program-suffix=4
>
> when configure php4 ? but is it enough
>
> any additional directions will be in favour
>
> Regards, Alexiev
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?3,28263,28383#msg-28383
>

You just need to be sure that both PHP installations do not overlap each
other. So if you have PHP5 installed on /usr, then you can install PHP4
on a different prefix (/usr/local, /opt, /srv/php4)

Then running something like this should work:

/usr/local/bin/php-fpm --fpm-config /usr/local/etc/php-fpm/php-fpm.conf

I assume you have PHP5 listening on port 9000, so you have to configure
PHP4 (the fpm) to listen on a different pot, i.e. 90001, and tell nginx
you want to use that port for your PHP4 websites:

server {
...

location ~ \.php$ {
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}

Regards
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 252
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready