HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Installation/Configuration (http://www.howtoforge.com/forums/forumdisplay.php?f=4)
-   -   php5 and php4 at the same time (http://www.howtoforge.com/forums/showthread.php?t=2480)

Hans 10th February 2006 13:05

php5 and php4 at the same time
 
I have read this "how to" with great interest:

http://www.howtoforge.com/apache2_with_php5_and_php4

I have a question about it:

Is it possible to add this as a little extra to a server running Debian 3.1 according "the perfect setup" including ISPConfig?

Or do i have to do this in another way?

falko 10th February 2006 14:58

Quote:

Originally Posted by Hans
Is it possible to add this as a little extra to a server running Debian 3.1 according "the perfect setup" including ISPConfig?

Yes, but I'd then put
Code:

AddHandler php-script .php4
Action php-script /cgi-bin/php4

into each Vhost seperately (using the Apache Directives field of ISPConfig) because otherwise PHP4 is always on (for every web site).
Also check the PHP5 configuration: PHP5 should not be enabled globally, so you must change /etc/apache2/mods_available/php5.conf (otherwise PHP5 is enabled for every web site, no matter what you specify in ISPConfig).

gog 15th February 2006 00:23

I've done it just today. I had a stable debian sarge system, running apache2, mysql-4.1, and php4 (all the modules installed in "the perfect setup").

I've decided to let php4 run like apache2 module, as it is in "the perfect setup", and I just wanted to add php5 as a cgi.

I just ran:

apt-get install php5-cgi

Then I had to edit my "httpd.conf" file, or better to say one virtaul host's directives. A added a line in one of the <VirutalHost...> entries:

Code:

AddHandler php-scriptt .php
Action php-scriptt /cgi-bin/php5

Notice the 2 tt's in the config file!!! I had to do it this way cause otherwise php4 always parsed the file in that directory, even when I tried to use .php5 extension.

I also added "Options +ExecCGI" to that directory, just in case, not shure if it's really needed.

This works like a charm, a can set php4/php5 on "per virtualhost" bases, or even per directory if I want to. Also, I don't need to change extension and do a search&replace on every skript that needs to be in PHP5. Not to mention the trouble you have to go, upgradeing one og these scripts...

It's kinda late now, have to catch some sleep :) I just need to install a cople more things, I want to install

Code:

apt-get install php5-curl php5-dev php5-gd php5-gmp php5-imap php5-ldap php5-mcrypt php5-mhash php5-ming php5-mysql php5-mysqli php5-odbc php5-pdo-mysql php5-pdo-sqlite php5-pear php5-pspell php5-snmp php5-sybase php5-tidy
(I'm not touching any php4 modules)

but I get a warning

Code:

The following packages will be REMOVED:
  php4-dev php4-pear

Hm, what to do? :) I would really like to leave pear repository for php4...

falko 15th February 2006 09:32

Quote:

Originally Posted by gog
It's kinda late now, have to catch some sleep :) I just need to install a cople more things, I want to install

Code:

apt-get install php5-curl php5-dev php5-gd php5-gmp php5-imap php5-ldap php5-mcrypt php5-mhash php5-ming php5-mysql php5-mysqli php5-odbc php5-pdo-mysql php5-pdo-sqlite php5-pear php5-pspell php5-snmp php5-sybase php5-tidy
(I'm not touching any php4 modules)

but I get a warning

Code:

The following packages will be REMOVED:
  php4-dev php4-pear

Hm, what to do? :) I would really like to leave pear repository for php4...

If you want to keep Pear for PHP4, then don't install the Pear package for PHP5 (php5-pear).

gog 15th February 2006 09:46

Yep, that's it. It work great! Maybe you should think of rewriting your original article? Or would you like me to write a new article "PHP5 extends The Perfect Setup - Debian Sarge (3.1)" :) ?

falko 15th February 2006 20:46

Quote:

Originally Posted by gog
Maybe you should think of rewriting your original article?

Why should I rewrite it? It's working... :)

fbnewtz 28th September 2006 06:17

Problem with upgrade
 
Whenever I try and run the following line I get the following output:
Code:

apt-get install php5-curl php5-dev php5-gd php5-gmp php5-imap php5-ldap php5-mcrypt php5-mhash php5-ming php5-mysql php5-mysqli php5-odbc php5-pdo-mysql php5-pdo-sqlite php5-pear php5-pspell php5-snmp php5-sybase php5-tidy php4-curl php4-domxml php4-gd php4-gmp php4-imap php4-ldap php4-mcal php4-mcrypt php4-mhash php4-ming php4-mysql php4-odbc php4-pspell php4-recode php4-snmp php4-xslt php4-xdebug curl libwww-perl imagemagick
Code:

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
  php5-curl: Depends: phpapi-20041225
            Depends: php5-common (= 5.1.6-0.dotdeb.2) but 5.1.6-1 is to be installed
  php5-gd: Depends: phpapi-20041225
  php5-gmp: Depends: phpapi-20041225
            Depends: php5-common (= 5.1.6-0.dotdeb.2) but 5.1.6-1 is to be installed
  php5-imap: Depends: phpapi-20041225
  php5-ldap: Depends: phpapi-20041225
  php5-mcrypt: Depends: phpapi-20041225
  php5-mhash: Depends: phpapi-20041225
  php5-ming: Depends: phpapi-20041225
  php5-mysql: Depends: phpapi-20041225
  php5-mysqli: Depends: phpapi-20041225
  php5-odbc: Depends: phpapi-20041225
  php5-pdo-mysql: Depends: phpapi-20041225
                  Depends: php5-common (= 5.1.6-0.dotdeb.2) but 5.1.6-1 is to be installed
  php5-pdo-sqlite: Depends: phpapi-20041225
                  Depends: php5-common (= 5.1.6-0.dotdeb.2) but 5.1.6-1 is to be installed
  php5-pear: Depends: php5-cli but it is not going to be installed
  php5-pspell: Depends: phpapi-20041225
              Depends: php5-common (= 5.1.6-0.dotdeb.2) but 5.1.6-1 is to be installed
  php5-snmp: Depends: phpapi-20041225
            Depends: php5-common (= 5.1.6-0.dotdeb.2) but 5.1.6-1 is to be installed
  php5-sybase: Depends: libct1 but it is not going to be installed
              Depends: phpapi-20041225
              Depends: php5-common (= 5.1.6-0.dotdeb.2) but 5.1.6-1 is to be installed
  php5-tidy: Depends: phpapi-20041225
            Depends: php5-common (= 5.1.6-0.dotdeb.2) but 5.1.6-1 is to be installed
E: Broken packages

Any ideas? I had different servers in my sources.list file, but I made a copy and created a new sources.list file with the same source as you specify in the server config.

I am running the Debian Perfect server setup with Ruby and FastCGI.

Thanks,

Fred

falko 29th September 2006 13:52

Quote:

Originally Posted by fbnewtz
I had different servers in my sources.list file

That's the reson for your problem.

Quote:

Originally Posted by fbnewtz
but I made a copy and created a new sources.list file with the same source as you specify in the server config.

That doesn't help because your system still has the packages of the other repositories in its package database.

Berry 21st November 2006 15:48

Sorry for reopening older post, I try to install those packages from gog's post, but I get errors
Code:

E: Package php5-mysqli has no installation candidate
E: Couldn't find package php5-pdo-mysql

I used Falco's sources links, did something change with those source links?...

EDIT: I tried also other source servers, for example :
Code:

deb http://dotdeb.pimpmylinux.org/ stable all
deb-src http://dotdeb.pimpmylinux.org/ stable all

but no success. Can someone point me to alternatives? Thanks!

falko 22nd November 2006 16:23

Maybe there is no package for php5-mysqli. You can search for all available PHP5 packages by running
Code:

apt-cache search php5
And make sure you run
Code:

apt-get update
whenever you change /etc/apt/sources.list!


All times are GMT +2. The time now is 00:39.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.