Web Hosting Talk







View Full Version : How to recompile Apache and PHP?


Adriaan
05-14-2002, 02:53 PM
I need to recompile Apache and PHP for letting cURL (a PHP module) work. I heard I need to install Apache and PHP manually and delete the RaQ packages.

I can't find the Apache and PHP source. Please help, I'm afread I'll do something wrong here.

Adriaan

Reg
05-15-2002, 06:53 PM
Recompiling Apache is very simple, at least on a Linux box. By doing it on a RaQ, you might break the control panel.

As for the sources:

http://httpd.apache.org
http://www.php.net

I recommend that you use a software called Apache Toolbox (http://www.apachetoolbox.com). It's a special software that basically asks you what all you want (Apache, Mod SSL, PHP, mySQL, modPerl, etc), then it does the rest (downloads, installs, configures, etc). That is the easiest method of compiling apache.

Adriaan
05-16-2002, 04:23 AM
Thanks for your reply,

So it's true I can't do this with the Cobalt packages. But when I recompile it like this I can't use the CP anymore?

Adriaan

roly
05-16-2002, 04:55 AM
don't use apachetoolbox on a raq coz it'll break the cobalt cp.

there is an apache 1.3.20 package on cobalt's site
for php 4.2.1 just overwrite the files

if u do that the cp will still work

Adriaan
05-16-2002, 01:41 PM
--with-curl=/usr/local/lib

Of course I could recompile PHP by putting the package in the CP again, but I must compile with the following line.

That isn't possible I think.

Adriaan
05-16-2002, 01:52 PM
I tried to reinstall the PHP package (in case it will see the cURL libs automaticly, I've put them in the default PHP lib dir that was in php.ini), but got the message "Package already installed." -- what's true.

Any solution?

Adriaan

Cephren
05-17-2002, 08:40 AM
. telnet into your server
2. switch to root user

su -

3. change to /usr/local/src directory

cd /usr/local/src

4. Download php source tarball:

wget http://www.php.net/..............l

tar xfz the PHP.tar

6. change to phpdirectory

cd phpdirectory

7. Copy and paste this new configure command line. Get the configure command line from above in phpinfo.php page and you'll need to add --with-mysql as well as change --with-db3 to --with-db so it looks like (i use a text file to hold this configure command so i can copy and paste it):

(remember to add curl into it)

quote:
--------------------------------------------------------------------------------

./configure --prefix=/usr --with-mysql --with-apxs=/usr/sbin/apxs --with-gd --with-gettext=/usr --enable-safe-mode --with-config-file-path=/etc/httpd --with-exec-dir=/usr/bin --with-zlib --enable-magic-quotes --with-regex=system --with-ttf=/usr/lib/libttf.so --enable-track-vars --enable-xml --disable-debug --with-db --with-interbase=shared --with-pgsql=shared --with-ldap --with-imap
--------------------------------------------------------------------------------

8. type

make

9. now backup the .so files that are currently in use


mkdir backup_so

mkdir backup_so/php

cp /etc/httpd/modules/libphp4.so ./backup_so/

cp /etc/httpd/modules/php/* ./backup_so/php/


10. type

make install

11. restart apache

/etc/rc.d/init.d/httpd stop
/etc/rc.d/init.d/httpd start

12. check your http://yourdomain.com/phpinfo.php