Linux Apache + MySQL + PHP

Source: Internet
Author: User

You may have heard of the great server-side scripting language php3. This article is its guide. However, php3 is only a brilliant history, and Zend PhP4 will be available in the future. It is bundled with apache1.3.12 and MySQL, which constitute a powerful combination.
We will focus on making Apache more omnipotent and add some improvements to PhP4. PhP4 has been solid since beta 2 and will be the final beta phase and released together with the Zend optimizer.
You need to download the following Source code :
Apache 1.3.12

PhP4 beta 4 Patch Level 1

MySQL 3.22.32

Zend Optimizer

Now move all of these to the "/usr/local/src" directory and unpack them:
MV * .tar.gz/usr/local/src/
CD/usr/local/src
Tar-zxvf Apache * .tar.gz
Tar-zxvf PHP * .tar.gz
Tar-zxvf MySQL * .tar.gz
Tar-zxvf Zend * .tar.gz
Install MySQL first.
CD MySQL *
./Configure -- prefix =/usr/local/MySQL
Make
Make install
CD/usr/local/MySQL/bin
./Mysql_install_db
./Safe_mysqld>/dev/null &
./Mysqladmin-u root password @ # yourdesiredpasswordhere @#
This will enable MySQL to start and run. You may want to start it at boot and modify it. To load MySQL at the boot time, you must put the following lines into the specified file.
./Safe_mysqld>/dev/null &
For RedHat Linux-based systems, you need to put the above lines in/etc/rc. d/RC. local, and for Debian GNU/Linux-based systems, you need to put it in/etc/init. d/RCS.
Next we will install Apache. Generally, when you upgrade from an existing apache version, you only need to upgrade it without messing up httpd. conf, but because we will support it with the dynamic shared object DSO, you will move the current httpd. conf to httpd. conf. save and use the new HTTP. conf. default.
CD/usr/local/Apache/Conf
MV httpd. conf httpd. conf. Save
CP httpd. conf. Default httpd. conf
Return to Apache source Code Directory and configure and install it.
CD/usr/local/src/apache_1.3.12
./Configure -- prefix =/usr/local/Apache -- enable-shared = max
Make
Make install
Compile Apache. Now that you have DSO support, if you are upgrading, you only need to compile Apache, not the new module. Now we need to do some work on PHP.
CD./php-4.0b4pl1
./Configure -- With-apxs =/usr/local/Apache/bin/apxs \
-- With-config-file-Path =/usr/local/Apache/conf \
-- With-mysql =/usr/local/MySQL -- enable-DEBUG = NO \ -- enable-track-vars
Make
Make install
Compile and install PHP and what we need. We must work with our configuration file.
Cp php. ini-Dist/usr/local/Apache/CONF/PHP. ini
CD/usr/local/Apache/Conf
Edit your httpd. conf file. You only need to do a few things unless you need to do something else. First, make sure that your configuration file supports all PHP modules and other modules. You should see some rows like this:
Loadmodule vhost_alias_module libexec...
Loadmodule...
Loadmodule php4_module libexec/libphp4.so
Clearmodulelist
Addmodule mod_vhost_alias.c
Addmodule...
Addmodule mod_php4.c
Make sure there is a long list of modules. If not, check the new httpd. conf. Default. They should have. Make sure that it also has PHP settings. If not, add the above lines. In httpd. conf, make sure that you have set up the PHP processor and mime. It should look like this. You must remove the comment:
Addtype application/X-httpd-PHP. php. php3. phtml
Addtype application/X-httpd-PHP-source. PHPs
This creates PHP for you. Now we will install the Zend optimizer. This is only a beta version and only has three optimization functions.
Mkdir/usr/local/Zend
Mkdir/usr/local/Zend/lib
CP/usr/local/src/Zend */zendoptimizer. So/usr/local/Zend/lib/
Now you need to update your PHP configuration file-PHP. ini and add the following two lines. No extra spaces or other things in the line:
Zend_optimizer.optimization_level = 1
Zend_extension = "/usr/local/Zend/lib/zendoptimizer. So"
After you have fully edited httpd. conf, start Apache and check whether it is correct.
CD ../bin
./Apachetcl start
Use the following PHP script:
You need to put these lines in a file-phpinfo. php, and then put the file into the root folder of your browser file. Then you can view it in your browser, and you should see information about Zend optimizer, PHP, Apache, and MySQL working together.

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.