Install and configure php5 MySQL5 Apache2 phpMyAdmin ZendOptimizer in Linux

Source: Internet
Author: User

You need to be careful and patient. During the installation process, you will be able to understand. If the installation is incorrect, you will be criticized.
In this example, under red hat 9
Php5.2.1
Apache2.2.4
MySQL5.0.37
Phpmyadmin2.10.0.2
ZendOptimizer-3.2.6
Libxml2-2.6.11
Installation and configuration
Where the libxml2-2.6.11 I downloaded under the/usr/directory
All others are downloaded to the/usr/down directory. These directories will be used in the following installation process
For windows php environment configuration can refer to the http://www.jb51.net/article/8569.htm

Prerequisites

Install GCC


Linux and C are inherently irrelevant. The main part of the linux kernel is written in C. In addition, many service software in Linux is written in C,
For example, MSSQL and Apache are written in C. If the gcc compiler is not installed, the software cannot be installed.
The above similar information indicates that GCC already exists. If you do not have it, install it on the CD first.
Thread model: posix gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-34)

1. Click the Red Hat menu> system Settings> Add/delete Application



2. If gcc has not been installed, the check box in front of the development tool is not checked. Check the development tool. Click Update in the lower right corner.
During installation, you will be prompted to insert a linux system disk.



Install libxml2

1. Click the Red Hat menu> System Tools> Terminal



2. Enter the command cd/usr/Enter
Go to the libxml2 source code directory



3. Execute tar-zxvf libxml2-2.6.11.tar.gz
Decompress the libxml2 source code.



4. the system automatically lists each decompression item.
Tip: After decompression, run the clear command to clear the screen.




5. Execute the cd libxml2-2.6.11
Enter the extracted directory.



6. Execute./configure




7. Execute make
Compile the source code.
Some source code compilation takes quite some time. You must be patient.



8. Execute make install
Install libxml2.



More articles php enthusiast station http://www.phpfans.net


Install MySQL

1. Run cd/usr/down
Go to the mysql source code directory.
Execute ls-l
List the files in the current directory.



2. Execute groupadd mysql




3. Execute useradd-g mysql




4. Execute tar-zxvf mysql-5.0.37.tar.gz
Decompress the mysql source code.



5. Execute the cd mysql-5.0.37
Enter the extracted directory.



6. Execute./configure -- prefix =/server/mysql
The prefix parameter specifies the mysql installation directory. We will install it in the/server/mysql directory.



7. Execute make




8. Execute make install




9. Run/server/mysql/bin/mysql_install_db -- user = mysql




10. execute cp support-files/my-medium.cnf/etc/my. cnf
Copy the mysql configuration file to the/etc/directory and save it as my. cnf




11. Run cp support-files/mysql. server/etc/rc. d/init. d/mysqld




12. Run chmod 700/etc/rc. d/init. d/mysqld.




13. Run chkconfig -- add mysqld.




14. Run cd/server/mysql
Go to the mysql installation directory.
And run chown-R root.
Note: Do not miss ".".



15. Run chown-R mysql var




16. Run chgrp-R mysql.
Do not miss ".".



17. Run/server/mysql/bin/mysqld_safe -- user = mysql &
Start mysql.



18. When mysqld ended appears, click Enter to return to the command line.




19. Run bin/mysql-u root-p
Log on to mysql.



20. The system will prompt you to enter the password. Because the password is not set during installation, the default password is blank. Click Enter to enter.




21. The following page indicates that mysql is installed and can be used.




22. Now let's test mysql.
Enter selcet version ();
View mysql version
Note: The SQL statement must end ";"
More articles php enthusiast station http://www.phpfans.net



23. We can see that it is indeed the mysql-5.0.37 we just installed.




24. Run quit;
Exit mysql command line.



Install Apache

1. Run cd/usr/down
Return to the directory where apache source code is located.



2. Execute tar-zxvf httpd-2.2.4.tar.gz




3. Execute the cd httpd-2.2.4




4. Execute./configure -- prefix =/server/apache -- enable-so




5. Execute make



6. Execute make install



7. Run/server/apache/bin/apachectl start
Start apache.



8. Open http: // localhost/or http: // 127.0.0.1 in the browser
If the following page appears, it indicates that apache has been installed.




Install php

1. Run cd/usr/down
Return to the php source code directory.



2. Execute tar-zxvf php-5.2.1.tar.gz




3. Execute the cd php-5.2.1




4. Execute./configure -- prefix =/server/php -- with-mysql =/server/mysql -- with-apxs2 =/server/apache/bin/apxs



5. Execute make



6. Execute make install



7. Run cp php. ini-dist/usr/local/lib/php. ini




More articles php enthusiast station http://www.phpfans.net


Configure Apache to associate with php

The hidden content of this post must be replied before browsing.

More articles php enthusiast station http://www.phpfans.net

11. click Esc. Return to the vi command line.
Enter wq and press Enter.
Where: wq is the command to save the disk and exit




Install ZendOptimizer

1. Run cd/usr/down
Return to the ZendOptimizer source code directory.



2. Execute tar-zxvf ZendOptimizer-3.2.6-linux-glibc21-i386.tar.gz




3. Execute the cd ZendOptimizer-3.2.6-linux-glibc21-i386




4. Run./install



5. Go to the following ZendOptimizer installation page. Click Enter.




6. Click "enter ".




7. Click "Yes" and press Enter.



8. Enter the ZendOptimizer installation path here. We will install it on/server/ZendOptimizer
Enter/server/ZendOptimizer and click the Tab key. Press enter on OK.




9. Select the location where php. ini is located. We have copied php. ini to/usr/local/lib in the previous installation.
So you don't need to modify it here. Click "enter" on "OK ".
More articles php enthusiast station http://www.phpfans.net



10. We use apache. Click "enter" on "Yes ".



11. Here we enter the location of apachectl. We are at/server/apache/bin/apachectl.
Enter/server/apache/bin/apachectl, click the Tab key, move the cursor to OK, and then press Enter.




12. Click Enter.



13. Click Enter.



14. Click Enter to restart apache



15. Click Enter to complete installation of ZendOptimizer



Environment Test

After the installation is complete, let's test whether the previously configured environment is correct.

1. restart apache again. Run/server/apache/bin/apachectl-k restart

Although apache has been restarted when ZendOptimizer is installed, We need to execute the following command to restart apache:
To ensure that the configuration modified by apache has been loaded from the new version, please do not miss this step.




2. Run vi/server/apache/htdocs/phpinfo. php
Create a phpinfo. php file under the root directory of the website.
/Server/apache/htdocs/is the root directory of our website. We only need to put the webpage here.
More articles php enthusiast station http://www.phpfans.net



3. Click I to enter the insert and edit mode.



4. Input
<? Php
Phpinfo ();
?>




5. Click Esc to return to the vi command line. Enter wq and press Enter.
The system will save the phpinfo. php file and exit the vi editor.




6. Open http: // localhost/phpinfo. php In the browser
If the following page is displayed, php has been installed. If a download dialog box is displayed, go to the page and find a solution.



If this interface appears, check that the first step of environment testing is to run/server/apache/bin/apachectl-k restart.
If the problem persists, we recommend that you restart linux once and then run/server/apache/bin/apachectl start to start apache. That's all.



7. Test whether php is associated with mysql.
Run vi/server/apache/htdocs/test. php
This step is forgotten. You just need to execute it.

8. Click I to enter the insert and edit mode. Then, enter
<? Php
// Phpfans http://www.phpfans.net
$ Conn = mysql_connect ("localhost", "root ","");
If ($ conn) echo "Else echo "?>




9. Click Esc to return to the vi command line mode. Enter wq and press Enter.




10. Open http: // localhost/test. php In the browser
The following interface indicates that php has successfully joined mysql.




Install phpMyAdmin

1. Run cd/usr/down
Return to the phpmyadmin source code directory.



2. Execute tar-zxvf phpMyAdmin-2.10.0.2-all-languages.tar.gz
Decompress phpmyadmin.



3. Run the cp-r phpMyAdmin-2.10.0.2-all-languages // server/apache/htdocs/phpmyadmin/
Cut phpmyadmin to the root directory of the website.



4. Open http: // localhost/phpmyadmin/in the browser/
The following page indicates that phpmyadmin has been installed



Please familiarize yourself with the specific functions of phpMyAdmin.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.