Install and configure php5MySQL5Apache2phpMyAdminZendOptimizer in Linux

Source: Internet
Author: User
I have come up with this configuration tutorial for a long time. I have been busy with internships and my graduation thesis recently. it never takes time. however, many people need this tutorial. so I decided to take a day out. the php environment configuration in linux is much more troublesome than that in windows. especially for source code installation. phpmyadminApacheZendOptimizer

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.bitsCN.com/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
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
// Phpfans http://www.phpfans.net
$ Conn = mysql_connect ("localhost", "root ","");
If ($ conn) echo "succeed ";
Else echo "fail ":
?>




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.