View previous topic :: View next topic |
Author |
Message |
zeveck Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/166839645642bdd5ac72cb4.gif)
Joined: 17 Mar 2005 Posts: 173 Location: Boston, MA
|
Posted: Sat Jan 07, 2006 11:33 pm Post subject: Downgrading PHP? |
|
|
So, I am running PHP5, and have been loving it. But, now I need to get webhosting for my site, and EVERY SINGLE HOST I have found only offers PHP4.
Anyhoo...I guess I need to convert my development machine down to PHP4. Are there any SNAFUs in doing this, or can I just throw a mask on PHP to restrict the version and downgrade away? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
!equilibrium Bodhisattva
![Bodhisattva Bodhisattva](/images/ranks/rank-bodhisattva.gif)
![](images/avatars/10751772074409c2c3ce8ec.png)
Joined: 06 Jun 2004 Posts: 2109 Location: MI/BG/LC
|
Posted: Sun Jan 08, 2006 2:58 pm Post subject: |
|
|
if you are using the ~x86 dev-lang/php you have both PHP4 and PHP5 on the same machine, and you can switch version using 'php-toolkit' _________________ Arch Tester for Gentoo/FreeBSD
Equilibrium's Universe
all my contents are released under the Creative Commons Licence by-nc-nd 2.5 |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
zeveck Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/166839645642bdd5ac72cb4.gif)
Joined: 17 Mar 2005 Posts: 173 Location: Boston, MA
|
Posted: Wed Jan 11, 2006 11:23 pm Post subject: |
|
|
I am using dev-lang/php ~x86, but it doesn't appear that I have both PHP4 and PHP5 installed...perhaps I am missing something? For instance, if I try 'emerge -p dev-php/php' I get:
Quote: | [blocks B ] dev-lang/php (is blocking dev-php/php-4.4.0-r4)
[ebuild N ] dev-libs/libgpg-error-1.0-r1
[ebuild N ] dev-libs/libgcrypt-1.2.2-r1
[ebuild N ] dev-libs/libxslt-1.1.15
[ebuild N ] app-text/aspell-0.50.5-r4
[ebuild N ] app-text/sablotron-1.0.1
[ebuild NS ] sys-libs/db-1.85-r2
[ebuild N ] net-libs/libwww-5.4.0-r4
[ebuild N ] dev-php/php-4.4.0-r4 |
Also, just today when I tried to update world I got:
Quote: | [blocks B ] dev-php/PEAR-Archive_Tar (is blocking dev-php/PEAR-PEAR-1.3.6-r2)
[blocks B ] dev-php/PEAR-Console_Getopt (is blocking dev-php/PEAR-PEAR-1.3.6-r2)
[blocks B ] dev-php/PEAR-XML_RPC (is blocking dev-php/PEAR-PEAR-1.3.6-r2)
[blocks B ] <dev-php/PEAR-PEAR-1.3.6-r2 (is blocking dev-php/PEAR-PEAR-1.3.6-r2)
[blocks B ] dev-lang/php (is blocking dev-php/php-4.4.0-r4)
[ebuild U ] sys-devel/gcc-config-1.3.12-r6 [1.3.12-r5]
[ebuild U ] dev-lang/php-5.1.1 [5.0.5-r4]
[ebuild U ] dev-php/PEAR-PEAR-1.3.6-r2 [1.3.6-r1]
[ebuild N ] dev-libs/libgpg-error-1.0-r1
[ebuild N ] dev-libs/libgcrypt-1.2.2-r1
[ebuild N ] dev-libs/libxslt-1.1.15
[ebuild N ] app-text/sablotron-1.0.1
[ebuild N ] net-libs/libwww-5.4.0-r4
[ebuild N ] app-text/aspell-0.50.5-r4
[ebuild NS ] sys-libs/db-1.85-r2
[ebuild N ] dev-php/php-4.4.0-r4
[ebuild UD] dev-php/PEAR-Archive_Tar-1.3.1 [1.3.2]
[ebuild U ] sys-apps/module-init-tools-3.2.1 [3.0-r2] |
So for some reason updating world has now decided it wants PHP4...but it cannot do both...
![Sad :(](images/smiles/icon_sad.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
!equilibrium Bodhisattva
![Bodhisattva Bodhisattva](/images/ranks/rank-bodhisattva.gif)
![](images/avatars/10751772074409c2c3ce8ec.png)
Joined: 06 Jun 2004 Posts: 2109 Location: MI/BG/LC
|
Posted: Thu Jan 12, 2006 1:22 pm Post subject: |
|
|
DarkAngel76 wrote: | and you can switch version using 'php-toolkit' |
wich part do you not understand?
if you emerge "dev-lang/php" you will have as dependecy 'php-toolkit', with it you can switch from PHP4 and PHP5 (dev-lang/php install both version) _________________ Arch Tester for Gentoo/FreeBSD
Equilibrium's Universe
all my contents are released under the Creative Commons Licence by-nc-nd 2.5 |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
zeveck Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/166839645642bdd5ac72cb4.gif)
Joined: 17 Mar 2005 Posts: 173 Location: Boston, MA
|
Posted: Thu Jan 12, 2006 1:41 pm Post subject: |
|
|
I understood that part. That has nothing to do with the fact that I am getting a handful of blocking warnings and an attempt to install PHP4 just by trying to update world.
Can I use php-select to select, say, PHP 4.3.11, or can I just say PHP4 vs. PHP5? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
!equilibrium Bodhisattva
![Bodhisattva Bodhisattva](/images/ranks/rank-bodhisattva.gif)
![](images/avatars/10751772074409c2c3ce8ec.png)
Joined: 06 Jun 2004 Posts: 2109 Location: MI/BG/LC
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
llongi Retired Dev
![Retired Dev Retired Dev](/images/ranks/rank-retired.gif)
![](images/avatars/184080807144bbbda6eff29.gif)
Joined: 15 Apr 2004 Posts: 459 Location: Switzerland
|
Posted: Thu Jan 12, 2006 11:17 pm Post subject: |
|
|
php-select is just to decide between PHP4 and PHP5, there is no support for installing multiple versions of PHP4 on the same system, you can't have 4.3.11 and 4.4.1 both installed at the same time, because they have the same SLOT.
The updated PHP upgrading guide is located at http://svn.gnqs.org/projects/gentoo-php-overlay/file/docs/php-upgrading.html?format=raw .
It's still trying to pull in dev-php/php because of a little quirk in how Portage managed dependencies, the other day the three packages PEAR-Archive_Tar, PEAR-Console_Getopt and PEAR-XML_RPC were directly included in PEAR-PEAR, and that creates some weird dependency etc. problems, just unmerge (emerge -C) those three packages and update your PEAR-PEAR package to 1.3.6-r2, that should solve it. _________________ Best regards, Luca. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
zeveck Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/166839645642bdd5ac72cb4.gif)
Joined: 17 Mar 2005 Posts: 173 Location: Boston, MA
|
Posted: Sun Jan 15, 2006 7:22 pm Post subject: |
|
|
I tried php-select apache2 php4 and got:
Quote: | ***error: compatible PHP version not found
compatible versions are:
* php5 |
It gives the same error if I try php-select apache2 php5.
![Crying or Very sad :cry:](images/smiles/icon_cry.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
xbmodder Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 25 Feb 2004 Posts: 404
|
Posted: Sun Jan 15, 2006 7:43 pm Post subject: |
|
|
You need a webhost with PHP5? I provide it, except its in /usr/beta/* instead of /. I use lighttpd so I can specify files with a .php in vhost.x with php5
PM me for more information. _________________ http://xbmodder.us/ |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
llongi Retired Dev
![Retired Dev Retired Dev](/images/ranks/rank-retired.gif)
![](images/avatars/184080807144bbbda6eff29.gif)
Joined: 15 Apr 2004 Posts: 459 Location: Switzerland
|
Posted: Mon Jan 16, 2006 4:24 pm Post subject: |
|
|
The php-select issue was indeed a bug in php-select and should be fixed within the 1.0-r2 version of php-toolkit I just added to the tree. _________________ Best regards, Luca. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
zeveck Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/166839645642bdd5ac72cb4.gif)
Joined: 17 Mar 2005 Posts: 173 Location: Boston, MA
|
Posted: Tue Jan 17, 2006 12:04 am Post subject: |
|
|
I now have php-toolkit-1.0_r2, but still get the same error when I try switching to PHP4.
Is it difficult to strip out PHP5 and just install PHP4? Or would I be advised to keep pegging until the select thing works correctly? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
zeveck Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/166839645642bdd5ac72cb4.gif)
Joined: 17 Mar 2005 Posts: 173 Location: Boston, MA
|
Posted: Tue Jan 17, 2006 1:18 pm Post subject: |
|
|
So, I am trying to actually install dev-php/php, but I specifically want version 4.3.11. I assured that by masking everything higher, but when I try to install mod_php it says that it needs php 4.4.0. How do I figure out which version of mod_php works with 4.3.11? Do I need to use apache 1.x do use PHP4? Are there any instructions on how to install PHP4 with Apache2? Most of the directions I can find are PHP4 with plain old Apache.
How much of a difference does the version of apache make for a development environment? If my web hosting is using PHP4 w/ Apache 1.3.3 should I try to mimick that exactly? Or will it be fine to develop on PHP4 w/ Apache 2.x?
[EDIT: I ended up just setting a mask for mod_php to restrict the version, which appeared to clear up that problem, but now it says that mod_php is blocked by apache2. =(]
Last edited by zeveck on Tue Jan 17, 2006 3:43 pm; edited 1 time in total |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
zeveck Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/166839645642bdd5ac72cb4.gif)
Joined: 17 Mar 2005 Posts: 173 Location: Boston, MA
|
Posted: Tue Jan 17, 2006 3:42 pm Post subject: |
|
|
I installed dev-php/php, but cannot find libphp4.so. =( |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
d11wtq Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/1790896682437f3ff79b696.gif)
Joined: 14 Jul 2005 Posts: 192 Location: Manchester, UK
|
Posted: Tue Jan 17, 2006 4:27 pm Post subject: |
|
|
Did you add the USE flag for apache or apache2 depending upon what server you're using?
If you want to switch to PHP4 from PHP5 just emerge -C the php5 version then:
Code: |
ACCEPT_KEYWORDS="~x86" USE="mysql apache2" emerge -pv =dev-lang/php-4.3.11-r5
|
That should set up the modules for apache and the httpd.conf file too.
Do you mind if I ask what the issue with just using PHP5 on the test server is? It's mostly backward compatible and the host will no doubt jump to v5 shortly... PHP5 is picking speed at being used on shared hosts now. It' a common misconception that PHP4 apps will not run in PHP5. Apart from *a few* function specification changes this is not true. OOP implemetation has been *extended* in PHP5 along with it's reference handling for objects but PHP4 OOP will still run under PHP5. Obviously, PHP5 OOP won't work on PHP4 but just don't write it in that case.
You can actually run both simultaneously on the same apache installation but it invloves using CGI for one and the apache module for the other.... this has security implications. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
zeveck Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/166839645642bdd5ac72cb4.gif)
Joined: 17 Mar 2005 Posts: 173 Location: Boston, MA
|
Posted: Tue Jan 17, 2006 8:32 pm Post subject: |
|
|
Great! That worked.
The reason I am switching to PHP4 is that I have only used PHP5 and do not know what kind of pitfalls might exist. Even though it is "mostly" backwards compatible, I was already bit because my classes all had "private" data members, which PHP4 doesn't support. I guess it is in hopes that I avoid such subtle-ish mistakes going forward. I'll just switch back to PHP5 whenever the host does.
Of course, there is some argument to the fact that my code will be needlessly outdated and/or relatively kludgy in terms of design versus what I could write with PHP5...but in this case development time wins out to future-portability, since I'd have to develop on PHP5 and then just retest/code under PHP4 whenever I did really rely on features of PHP5.
But yes, I'd rather be using PHP5.
![Confused :?](images/smiles/icon_confused.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|