Web Hosting Talk







View Full Version : FreeBSD and PHP 4.3.0


Casp3r
12-31-2002, 05:56 AM
Hello there,
A few days ago the PHP team have released the new version of php.
As a FreeBSD user I'm always waiting for the ported version and then just "making install" and it all installes automaticly nice and dandy.
The only problem is that the new version hasn't been released to ports yet and I need to upgrade my version pronto because my server isn't working =\.
My question here is actually:
Anybody knows how to install the new php manually on a freebsd box or at least when it'll come out as a ported version to FreeBSD?

Thanks.

ice53ltd
12-31-2002, 06:41 AM
Hello,

We upgraded our FreeBSD machines to PHP 4.3.0 within an hour after its release - it is an extremely simple process.

However, if your server isn't working at the moment don't assume that an upgrade to the latest version of PHP will fix things.

Anyway, to do the upgrade download the source code and untar it into some directory and then cd into that directory. The basic process is as follows:

./configure
make
make install

configure will need some options being passed to it since configure controls which extensions PHP is built with, you can use:

./configure --with-apxs --with-mysql --with-gd=/usr/local --enable-gd-native-ttf --with-jpeg-dir=/usr/local/lib --with-png-dir=/usr/local/lib --with-freetype-dir=/usr/local/lib --enable-trans-sid --enable-wddx --with-openssl --with-zlib --enable-ftp --with-sockets --with-pear --with-gettext --enable-pcntl --enable-shmop --with-mm --enable-wddx --with-imap --with-imap --with-sockets --with-xml --with-mcrypt --with-pspell --with-curl

For more options read the PHP manual online.

Before you do any of the above you should read the manual and remember that it could all go horribly wrong leaving your machine in a non-working state so you should take all precautions such as backing up your existing php install and trying the upgrade on a non-production box first.

If the above fails don't blame me.

We only encountered one problem during our upgrade, the PHP CGI wasn't built or installed, only the Apache modules and new CLI binaries were built and installed. If you use PHP as a CGI binary you will have to go back and use a different line to build the CGI module.

Casp3r
12-31-2002, 07:10 AM
Ok,
I did what you told me and it gave me an error code 1.
Here is what it says:
bash-2.05b# make install
Installing PHP SAPI module
cp: sapi/cgi/php: No such file or directory
*** Error code 1

Stop in /usr/home/casper/php-4.3.0.

ice53ltd
12-31-2002, 07:44 AM
yep, we had that problem too... (I mentioned it in my post). Do this:

Do configure (don't do make clean at this point) again but this time without --with-apxs and add --enable-cgi

Do make again, then do make install. You can now do a make clean to tidy things up.

Casp3r
12-31-2002, 08:21 AM
Thanks for you reply.
I did what you told me but it won't show me php files now...
It shows me a php file as a text file. any idea?

ice53ltd
12-31-2002, 08:32 AM
Hmm.. sounds like your httpd.conf file may not have the correct entries.

Make sure the following lines exist in httpd.conf:
LoadModule php4_module libexec/libphp4.so
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

Casp3r
12-31-2002, 08:40 AM
I added those lines and it still gives me the same problem =\

rcs
12-31-2002, 10:36 AM
restart apache and get an admin

ice53ltd
12-31-2002, 10:42 AM
Hmm... check libexec/libphp4.so exists, it may be that it wasn't installed properly.

rcs
12-31-2002, 10:43 AM
libphp4.so will not be created without --with-apxs

ice53ltd
12-31-2002, 12:25 PM
rcs, libphp4.so should have been created the first time (when Casper did have --with-apxs), a rebuild was only done to create the CGI binary, should have left the apache module intact.


Edited: a typo