View previous topic :: View next topic |
Author |
Message |
ScriptBlue n00b
Joined: 27 Jul 2005 Posts: 21 Location: New York City, New York, US
|
Posted: Mon Aug 01, 2005 9:42 pm Post subject: HOWTO Install PHP5 |
|
|
Side Note:
This is the overlay mentioned here in package.mask
Quote: | # Stuart Herbert <stuart@gentoo.org> (10 Jun 2005)
# Masked until the eclass is finished, and the PECL packages are done
|
1)Download
http://dev.gentoo.org/~stuart/php/php-overlay.tar.gz
2)Unpack
Unpack the gziped tarball into /usr/local/portage so after you are done you should have /usr/local/portage/dev-lang/
3)Necessary programs
This may seem redunant however, do not forget to remove your previous PHP installationg ( emerge -C php ). You may have installed a couple of things with the name PHP, such as mod_php, and php cli. So you should run emerge -C php until emerge tells you no packages match that keyword.
If you are not using net-www/apache-2.0.54-r10 or above you will have to erase apache ( emerge -C apache ).
4)Editing settings
- 1: /etc/make.conf
Add the following line to /etc/make.conf so Portage's emerge will look in that directory
Code: | PORTDIR_OVERLAY=/usr/local/portage |
I do not recommend this but it might be the method with the less headache.
Add the following line to make.conf and promptly remove it after installing PHP5
Code: | ACCEPT_KEYWORDS="~x86" |
2: /etc/portage/package.keywords
This is for future use,
Add this line, (it will unmask the new php overlay)
3:/etc/portage/package.use
This file will set the USE flags for your PHP installation and remember them without mass editing through make.conf
Code: | dev-lang/php cli cgi apache2 sockets |
as well as
Code: | net-www/apache mpm-prefork |
If you are wondering what mpm-prefork is check this link out, as well as other possibilies
http://httpd.apache.org/docs/2.0/mod/worker.html
http://webauthv3.stanford.edu/manual/mod/threadpool.html
http://httpd.apache.org/docs/2.0/mod/prefork.html
http://ecaimaps.berkeley.edu/manual/mod/leader.html
5)Checking packages
To see which packages will be emerged with what USE flags type
Code: | emerge -pv dev-lang/php |
For PHP5 Apache should have ONE MPM, I suggest you use prefork because it is the most stable mod for Apache with PHP.
If you do not find a package you need either edit /etc/portage/package.use or use the USE="..." emerge ... flag
Note: there might be a filesize error with the ebuild, so you will have to cd /usr/portage/local/dev-lang and digest the ebuild like so,
Code: | ebuild [insert name of the ebuild] digest |
7)Emerge
PHP5 needs DBA support so....
USE="dba" emerge dev-lang/php
6)Enjoy
After this you should be set but don't forget to actually emerge php
Thanks to Stuart for writing such a great overlay as well as helping me install it.
Just in case you are wondering, here's my emerge package list
Quote: |
These are the packages that I would merge, in order:
Calculating dependencies ...done!
[ebuild N ] dev-libs/apr-0.9.6-r3 +ipv6 0 kB
[ebuild N ] dev-libs/apr-util-0.9.6-r2 +berkdb +gdbm -ldap 0 kB
[ebuild N ] net-www/apache-2.0.54-r13 +apache2 -debug -doc -ldap -mpm-leader -mpm-peruser +mpm-prefork -mpm-threadpool -mpm-worker -no-suexec (-selinux) +ssl -static-modules -threads 49 kB
[ebuild N ] dev-lang/php-5.0.4 -adabas -apache +apache2 +bcmath +berkdb -birdstep +bzip2 +calendar -cdb -cgi +cli +crypt -ctype +curl -curlwrappers -db2 -dba -dbase -dbm -dbmaker -dbx -debug -empress -empress-bcs -esoob +exif -fdftk -filepro -firebird -flatfile -frontbase +ftp +gd +gd-external +gdbm -gmp -hardenedphp -hyperwave-api +iconv +imap -informix +inifile -interbase -iodbc +jpeg -kerberos -ldap -libedit -mcve -memlimit -mhash +mime -ming -mkconfig +msession -msql -mssql +mysql -mysqli +ncurses +nls -oci8 -odbc -oracle7 -ovrimos +pcntl -pcre -pear -pfpro +png -posix -postgres -qdbm +readline -recode -sapdb -sasl +session -sharedext -sharedmem +simplexml -snmp -soap +sockets -solid +spell -spl +sqlite +ssl -sybase -sybase-ct -sysvipc -threads -tidy +tiff +tokenizer +truetype -wddx +xml2 +xmlrpc -xpm -xsl +zlib 0 kB
|
--------
This is my first how to, sorry if it doesn't follow the normal layout, I tried |
|
Back to top |
|
|
stuherbert Retired Dev
Joined: 17 Aug 2003 Posts: 47 Location: Pontypridd, South Wales
|
Posted: Mon Aug 01, 2005 9:48 pm Post subject: |
|
|
Just a quick note to thank ScriptBlue for his HOWTO, and to let everyone know that, if PHP5 on Gentoo is important to you, this is your chance to see what it will look like when it's done - and to let me know whether it meets your needs or not.
Best regards,
Stu _________________ --
stuart@gentoo.org
Gentoo Developer
Trustee, Gentoo Foundation
http://blog.stuartherbert.com |
|
Back to top |
|
|
stuherbert Retired Dev
Joined: 17 Aug 2003 Posts: 47 Location: Pontypridd, South Wales
|
Posted: Mon Aug 01, 2005 9:52 pm Post subject: |
|
|
Also, if you want to know what's going on with PHP5 support on Gentoo, follow my blog postings on Planet Gentoo.
Best regards,
Stu _________________ --
stuart@gentoo.org
Gentoo Developer
Trustee, Gentoo Foundation
http://blog.stuartherbert.com |
|
Back to top |
|
|
whyscream n00b
Joined: 17 Feb 2004 Posts: 46
|
Posted: Tue Aug 02, 2005 8:39 am Post subject: |
|
|
Another note to users trying this overlay for the first time:
the dev-lang/php ebuild can provide all of the previous php binaries. Choosing between them can be done via USE-flags:
Code: | dev-php/php: USE="cli"
dev-php/mod_php: USE="apache apache2" (one of these)
dev-php/php-cgi: USE="cgi"
|
Just in case you are waiting for an php emerge that compiles 2 binaries that you won't need |
|
Back to top |
|
|
mserms Apprentice
Joined: 13 Jan 2005 Posts: 162 Location: Edinburgh
|
Posted: Tue Aug 02, 2005 9:29 am Post subject: |
|
|
Has anyone any experience of running PHP4 alongside PHP5 with the overlay tarball?
Also, FWIW, this recent version of the tarball (PHP5.1beta-r3) has fixed problems I was having with installing pecl extensions. |
|
Back to top |
|
|
YD Guru
Joined: 30 Oct 2004 Posts: 466 Location: Riga, Latvia
|
Posted: Tue Aug 02, 2005 9:45 am Post subject: |
|
|
Currently I'm using modified portage ebuilds.
- Does this tarball work well with MySQL4.1 + mysqli?
- Does it have independant mbstring flag (without nls support) ?
- Is there any flag to install php-config/phpize without installing a separate package?
P.S. Also I had a problem when phpize generates a configure script which requires autoconf-2.13, but there are autoconf-2.5 macros. So I had to use WANT_AUTOCONF="2.5" emerge blablabla |
|
Back to top |
|
|
andreask Apprentice
Joined: 09 Sep 2003 Posts: 282 Location: Aachen, Germany
|
|
Back to top |
|
|
StifflerStealth Retired Dev
Joined: 03 Jul 2002 Posts: 968
|
Posted: Tue Aug 02, 2005 1:47 pm Post subject: |
|
|
Great HOWTO, but you might want to expand this tutorial to cover setting up mod_php with apache2 as well. I know there are still some people out there that can't get it to work.
Oh, one question. Is PHP being moved to dev-lang instead of being in dev-php? That is onething I noticed with the overlay, but in portage, php is still in dev-php.
Thanks _________________ Nothing to read in this sig. Move along. |
|
Back to top |
|
|
mserms Apprentice
Joined: 13 Jan 2005 Posts: 162 Location: Edinburgh
|
Posted: Tue Aug 02, 2005 3:00 pm Post subject: |
|
|
Another little question: how do I get the MySQL PDO drivers installed with PHP 5.1 beta 1? I have mysql in my use flags, and do not have sqlite in my use flags, but only have the SQLite PDO drivers.
Any thoughts? |
|
Back to top |
|
|
stuherbert Retired Dev
Joined: 17 Aug 2003 Posts: 47 Location: Pontypridd, South Wales
|
Posted: Tue Aug 02, 2005 4:10 pm Post subject: |
|
|
dev-lang/php will eventually replace the three packages dev-php/php, dev-php/php-cgi, and dev-php/mod_php. It will replace them very soon for PHP 5, and eventually for PHP 4 as well.
PDO support will be added later this week. This question has already been answered by my blog posts mentioned above. Please make an effort to follow the blog posts, so that I don't spend all my time answering questions like this!
Thanks,
Stu _________________ --
stuart@gentoo.org
Gentoo Developer
Trustee, Gentoo Foundation
http://blog.stuartherbert.com |
|
Back to top |
|
|
mserms Apprentice
Joined: 13 Jan 2005 Posts: 162 Location: Edinburgh
|
Posted: Wed Aug 03, 2005 8:20 am Post subject: |
|
|
stuherbert wrote: | PDO support will be added later this week. This question has already been answered by my blog posts mentioned above. Please make an effort to follow the blog posts, so that I don't spend all my time answering questions like this! |
Stuart, I have been following the blog posts (with interest), although they have been inconsistent with the tarball recently. You mentioned that "ebuilds for pecl-pdo and its assorted drivers" will be added later, yet my PHP installation has PDO enabled for SQLite. Thanks for all your work on this, I really think it's looking like a great system - however, don't ask for people to test stuff and then get irritated when they do show an interest and need to ask questions. |
|
Back to top |
|
|
andreask Apprentice
Joined: 09 Sep 2003 Posts: 282 Location: Aachen, Germany
|
Posted: Wed Aug 03, 2005 8:33 am Post subject: |
|
|
Code: | andreas@test php-5.1.0b3 $ ./configure --help | grep -i pdo
--disable-pdo Disable PHP Data Objects support
--with-pdo-dblib[=DIR] Include PDO_DBLIB-DB support. DIR is the FreeTDS home
--with-pdo-firebird[=DIR] PDO: Firebird support. DIR is the Firebird base
--with-pdo-mysql[=DIR] PDO: MySQL support. DIR is the MySQL base directory
--with-pdo-oci[=DIR] PDO: Oracle-OCI support. Default DIR is ORACLE_HOME.
You may also use --with-pdo-oci=instantclient,prefix,version to use
--with-pdo-oci=instantclient,/usr,10.1.0.3
--with-pdo-odbc=flavour,dir
PDO: Support for 'flavour' ODBC driver.
--with-pdo-odbc=unixODBC
--with-pdo-odbc=generic,dir,libname,ldflags,cflags
named pdo_odbc.so
--with-pdo-pgsql[=DIR] PDO: PostgreSQL support. DIR is the PostgreSQL base
--without-pdo-sqlite PDO: sqlite 3 support
|
PDO and PDO-SQLITE are enabled by default in PHP 5.1. |
|
Back to top |
|
|
mserms Apprentice
Joined: 13 Jan 2005 Posts: 162 Location: Edinburgh
|
Posted: Wed Aug 03, 2005 8:36 am Post subject: |
|
|
Ah, that's more like it! Thanks andreask. |
|
Back to top |
|
|
Redeeman l33t
Joined: 25 Sep 2003 Posts: 958 Location: Portugal
|
Posted: Wed Aug 03, 2005 9:57 am Post subject: |
|
|
why are this overlay needed? i run php5 perfectly fine with the ebuilds that is currently masked in portage |
|
Back to top |
|
|
andreask Apprentice
Joined: 09 Sep 2003 Posts: 282 Location: Aachen, Germany
|
|
Back to top |
|
|
Redeeman l33t
Joined: 25 Sep 2003 Posts: 958 Location: Portugal
|
Posted: Wed Aug 03, 2005 10:32 am Post subject: |
|
|
oh well.. when this gets into portage, i will upgrade, but untill then php5 works flawlessly as it is now |
|
Back to top |
|
|
stuherbert Retired Dev
Joined: 17 Aug 2003 Posts: 47 Location: Pontypridd, South Wales
|
Posted: Wed Aug 03, 2005 10:34 pm Post subject: |
|
|
Try installing an existing PECL package, or try running a mixed PHP4 / PHP5 environment, and you'll quickly see why the existing dev-php/php and dev-php/mod_php ebuilds need replacing with a different solution.
Things are looking good that we'll be able to move the packages from the overlay into Portage over the weekend.
Best regards,
Stu _________________ --
stuart@gentoo.org
Gentoo Developer
Trustee, Gentoo Foundation
http://blog.stuartherbert.com |
|
Back to top |
|
|
andreask Apprentice
Joined: 09 Sep 2003 Posts: 282 Location: Aachen, Germany
|
|
Back to top |
|
|
Redeeman l33t
Joined: 25 Sep 2003 Posts: 958 Location: Portugal
|
Posted: Thu Aug 04, 2005 1:01 am Post subject: |
|
|
well i am not interrested in running mixed php4/5, however pecl might be interresting..
i just hope this thing wont make the php5 support worse, since as for me, its working quite perfect..
anyway, when it gets merged into portage i will certainly try it out |
|
Back to top |
|
|
jonasmattsson n00b
Joined: 20 May 2004 Posts: 71 Location: Gothenburg, Sweden
|
Posted: Thu Aug 04, 2005 7:50 pm Post subject: |
|
|
This is probably a silly question, but i follow the guide and i cant get the apache to preprocess my php-file, firefox only offers me to download the file. what to do? |
|
Back to top |
|
|
StifflerStealth Retired Dev
Joined: 03 Jul 2002 Posts: 968
|
Posted: Thu Aug 04, 2005 8:41 pm Post subject: |
|
|
First, make sure that you compiled dev-lang/php with the apache2 use flag.
Then, edit the file: /etc/conf.d/apache2
next change the line from: Quote: | APACHE2_OPTS="-D DEFAULT_VHOST" | to: Quote: | APACHE2_OPTS="-D DEFAULT_VHOST -D PHP5" |
then type: Code: | /etc/init.d/apache2 restart |
That is all I did to get it to work. _________________ Nothing to read in this sig. Move along. |
|
Back to top |
|
|
mserms Apprentice
Joined: 13 Jan 2005 Posts: 162 Location: Edinburgh
|
Posted: Fri Aug 05, 2005 8:13 am Post subject: |
|
|
jonasmattsson wrote: | This is probably a silly question, but i follow the guide and i cant get the apache to preprocess my php-file, firefox only offers me to download the file. what to do? |
I needed to upgrade apache to get the overlay to work, but something definitely went screwy with it. Seemed like the init script wasn't properly stopping apache, so I needed to "killall apache2" and then restart (using the init script) which seemed to sort it out. Not sure if that helps. |
|
Back to top |
|
|
djcronos n00b
Joined: 02 Oct 2004 Posts: 53 Location: San Jose, CA
|
Posted: Mon Aug 08, 2005 6:00 pm Post subject: |
|
|
I must say this is indeed an awesome tutorial, yet I'm still a little confused with a few things. I plan on posting a separate topic, but I feel this needs to be mentioned in this topic as well (and possibly having this HOWTO updated as a result?)
On a side note, I'm still somewhat a novice when it comes to setting up PHP4/5 on a linux system, altho I am well experienced in getting it set up, anything beyond basic setup and editing of conf files is still a bit hazy, but I am eager to learn (and research more, if need be).
Our company wants me to use Komodo to collaborate with other developers. I've successfully installed PHP5 using this howto, and running a test php script shows me I'm running PHP 5.1 flawlessly (so far). I then installed Komodo, and when it searched for installed libraries, it only found Perl and Python. I'm assuming two things here:
1) Since Perl and Python were found in /usr/bin and there is no sign of PHP anything in there, I need to make a symbolic link to point to the PHP5 directory
2) I have read that PHP5 comes with its own CLI and PHP5 for Apache was renamed php-cgi - is that true?
Also, I'm used to when emerging something that is CLI based, that I can easily just type in the name of the program from a CLI and hit tab to autocomplete the name (or bring up a list of programs that start with the command I typed) yet I see nothing for PHP. How would a symlink that? When I find the PHP5 cli, do I just make a symlink to /usr/bin?
I don't think I need help on the Komodo part, just knowing where this install puts PHP5. I'm checking my sytem now, but figured I'd throw up this question while I look. I'll give a heads up when I find out more.
Thanks guys. _________________ Linux Lover #370481
Get Counted! |
|
Back to top |
|
|
andreask Apprentice
Joined: 09 Sep 2003 Posts: 282 Location: Aachen, Germany
|
Posted: Mon Aug 08, 2005 6:21 pm Post subject: |
|
|
djcronos wrote: | I must say this is indeed an awesome tutorial, yet I'm still a little confused with a few things. I plan on posting a separate topic, but I feel this needs to be mentioned in this topic as well (and possibly having this HOWTO updated as a result?) |
perhaps look at the project page: http://svn.gnqs.org/projects/gentoo-php-overlay/
djcronos wrote: | I've successfully installed PHP5 using this howto, and running a test php script shows me I'm running PHP 5.1 flawlessly (so far). |
you run a test-script using mod_php or cli/cgi?
The cli and cgi binaries will be installed to:
Code: | /usr/lib/php[45]/bin/php
/usr/lib/php[45]/bin/php-cgi |
So one of these files has to be symlinked, which could be done using the eselect module (from Stuarts overlay-directory). But AFAIK this has been improved so it's done automatically, if you install only one PHP-Version.
djcronos wrote: | 1) Since Perl and Python were found in /usr/bin and there is no sign of PHP anything in there, I need to make a symbolic link to point to the PHP5 directory |
correct.
djcronos wrote: | 2) I have read that PHP5 comes with its own CLI and PHP5 for Apache was renamed php-cgi - is that true? |
if you use the "apache[2]" USE-flag, you will get mod_php, which is installed as Apache-module. If you use "cgi" USE-flag, you will get a
Code: | /usr/lib/php[45]/bin/php-cgi |
binary. If you use the "cli" USE-flag, you will get
Code: | /usr/lib/php[45]/bin/php |
djcronos wrote: | Also, I'm used to when emerging something that is CLI based, that I can easily just type in the name of the program from a CLI and hit tab to autocomplete the name (or bring up a list of programs that start with the command I typed) yet I see nothing for PHP. How would a symlink that? When I find the PHP5 cli, do I just make a symlink to /usr/bin? |
If you need only one version of php, try the latest overlay: http://svn.gnqs.org/projects/gentoo-php-overlay/wiki/Downloads
If you need php4 and php5, portage cannot decide which one should be used, so you must use eselect to choose the a version or symlink it (in /usr/bin) as described above. |
|
Back to top |
|
|
Styles Tux's lil' helper
Joined: 04 Jun 2002 Posts: 82
|
Posted: Tue Aug 09, 2005 7:25 pm Post subject: |
|
|
Well I need to get fruity installed for nagios and it req php5, but I'm running into one problem
Code: | checking for db4 major version... configure: error: Header contains different version |
I have rebuilt db and tried again with the same error?
Anybody have any Ideas ? |
|
Back to top |
|
|
|