Www.mysql.com, www.apache.org, www.php.net download the latest mysql, apache, php
Source code package
Mysql-standard-5.0.1-alpha-snapshot-pc-linux-i686.tar.gz
Httpd-2.0.52.tar.gz
Php-5.0.2.tar.gz
Install mysql first
Cp mysql-standard-5.0.1-alpha-snapshot-pc-linux-i686.tar.gz/usr/local/
Tar-zxvf mysql-standard-5.0.1-alpha-snapshot-pc-linux-i686.tar.gz
Cd mysql-standard-5.0.1-alpha-pc-linux-i686/
INSTALL emacs-BINARY to obtain the installation information.
Groupadd mysql
Useradd-g mysql
Cd/usr/local/
Ln-s mysql-standard-5.0.1-alpha-pc-linux-i686/mysql build soft link
./Scripts/mysql_install_db -- user = mysql
Chown-R root.
Chown-R mysql data
Chgrp-R mysql.
./Bin/mysqld_safe -- user = mysql & start mysql from the background, then you will see
[1] 3879
[Root -- 1014 --/usr/local/mysql] Starting mysqld daemon with databases from/usr/local/mysql/data
You can use ps-aux │ grep mysql to verify that the operation has been successful.
Installed successfully
Install apache again
Tar-zxvf httpd-2.0.52.tar.gz
Cd httpd-2.0.52
Emacs INSTALL to obtain some installation information
./Configure -- enable-so
Make; make install
Cd/usr/local/apache2/bin
./Apachectl start
Httpd: cocould not determine the servers fully qualified domain name, using 127.0.0.1 for ServerName
In this case, open your browser and enter 127.0.0.1 or your computer name. My name is tian1118. Then you can see the beautiful feathers, proving that apache is successfully installed and that the simplified Chinese is displayed correctly, really nice.
Let's take a closer look. It seems like a problem.
Cd/usr/loca/apache2/conf/
Back up cp httpd. conf beifei to avoid self-correction.
Emacs httpd. conf
Find # ServerName www.example.com: 80
Change it to ServerName 127.0.0.1
../Bin/apachectl restart no error prompt to prove successful
Install php again
Tar-zxvf php-5.0.2.tar.gz
Cd php-5.0.2
Emacs INSTALL to obtain some installation information
./Configure -- with-apxs2 =/usr/local/httpd/bin/apxs -- with-mysql =/usr/local/mysql
If the following code is displayed, it indicates that the operation is almost successful.
+ -------------------------------------------------------------------- +
│ License: │
│ This software is subject to the PHP License, available in this │
│ Distribution in the file LICENSE. By continuing this installation │
│ Process, you are bound by the terms of this license agreement. │
│ If you do not agree with the terms of this license, you must abort │
│ The installation process at this point. │
+ -------------------------------------------------------------------- +
Thank you for using PHP.
Make
Make install
Cp php. ini-dist/usr/local/lib/php. ini
Cp: overwrite '/usr/local/lib/php. ini '? Y
Integration of php and apache
Replace DirectoryIndex in emacs/usr/local/apache2/conf/httpd. conf as follows:
DirectoryIndex index.html index. php index.htm index.html. var
Find
AddType application/x-compress. Z
AddType application/x-gzip. gz. tgz
Add
AddType application/x-httpd-php. php
/Usr/local/apache2/bin/apachectl restart
Test php
Emacs/usr/local/apache2/htdocs/index. php
Add
Open your browser and enter
Http: // 127.0.0.1/index. php
You can see the information about php to prove that php is successfully installed.
Conclusion: It is strongly recommended that you use the source code to install the software. Although it is troublesome, you know what you have done and where you have installed the software package, if something goes wrong, don't worry. first check the error prompt, view the error information, and use the linxu knowledge you have learned to determine what went wrong. For example, when I was installing php, I want to install apache first, then php, and finally mysql. When I add the parameter -- with-mysql =/usr/local/mysql when installing php, an error will occur during installation, also, when installing php, it prompts that my libxm12 version is too low. My version is RD9.0 and the kernel is 2.4.20-8. When I use rpm-qa │ grep libxm12, I downloaded libxml2-2.6.10.tar.gz later, install php after installation ,.