Do not install apache for the first time. because php compilation requires apache to be compiled at least once, note that the source code packages of apache and php are in the same directory. -- with-apache = .. /apache_1.3.27 indicates the directory to which the source code is extracted.
Static/dynamic compilation of Apache php mysql
Required software:
Apache: 1.3.27
Php: 4.3.2
Mysql: 4.0.13
First install mysql
Tar zvxf mysql-4.0.13.tar.gz
Cd mysql-4.0.13
./Configure -- prefix =/usr/local/mysql -- sysconfdir =/etc -- localstatedir =/var/lib/mysql
Make
Make install
Installation is complete.
Then initialize the database
/Usr/local/mysql/bin/mysql_install_db -- user = mysql
Set permissions:
Chown-R root/usr/local/mysql
Chown-R mysql/usr/local/mysql/var
Chgrp-R mysql/usr/local/mysql
Copy the configuration file;
Cp/usr/local/mysql/share/mysql/my-medium.cnf/etc/my. cnf
Start mysql:
/Use/local/mysql/bin/mysqld_safe -- user = mysql &
Change Password: the initial root password is empty.
/Usr/local/mysql/bin/mysqladmin-u root-p password 123456
Enter password:
Change the password to 123456. because the initial password is empty, enter password and press enter.
Test the new password:
Mysql-u root-p mysql
Enter password: 123456
If it succeeds, you can enter mysql.
First, it is the static compilation of apache1.3.29 php4.3.4 mysql4.0.13.
Do not install apache for the first time. because php compilation requires apache to be compiled at least once
Tar zvxf apache_1.3.27.tar.gz
Cd apache_1.3.27
./Configure -- prefix =/usr/local/apache
Compile php
Tar zvxf php4.3.4.tar.gz
Cd php4.3.4
./Configure -- prefix =/usr/local/php -- with-mysql =/usr/local/mysql \
-- With-apache = ../apache_1.3.27
Make
Make install
The second compilation and installation of apache:
Cd .. /apache_1.3.29. /configure -- prefix =/usr/local/apache \ -- activate-module = src/modules/php4/libphp4.a makemake install cp .. /php4.3.4/php. ini. dist/usr/local/php/lib/php. ini correction/usr/local/apache/conf/httpd. conf search
Add in this category
AddType application/x-httpd-php. php
AddType application/x-httpd-php-source. phps
Note: the source code packages of apache and php are in the same directory. -- with-apache = ../apache_1.3.27 indicates the directory to which the source code is extracted.
OK! Static Compilation is complete. you only need to start the server.
/Usr/local/apache/bin/apachectl start
Then, enter the php test page info. php: the content is as follows:
Normally, you should be able to see the php information, so the static compilation is successful!
The following describes how to dynamically compile DSO:
First, compile and install apache
Tar zvxf apache_1.3.29
Cd apache_1.3.29
./Configure -- prefix =/usr/local/apache -- enable-module = so \
-- Enable-module = rewrite
Make
Make install
The so module is used to provide the apachehe core module supported by DSO. rewrite is the address rewriting module. if you do not need it, you can skip the compilation.
Enable-shared = max indicates that all the scale modules except so are compiled into DSO modules.
Then compile php
Tar zvxf php4.3.4.tar.gz
Cd php4.3.2
./Configure -- prefix =/usr/local/php -- with-mysql =/usr/local/mysql \
-- With-apxs =/usr/local/apache/bin/apxs
Make
Make install
Then, modify httpd. conf in the same way as static compilation.
OK. Dynamic compilation is complete. What are the differences between them!