Linux APACHE+MYSQL+PHP_ Server

Source: Internet
Author: User
Tags install php mkdir mysql in php script zend
You may have heard of the great server-side scripting language-php3, and this article is its guide. However, PHP3 is only a glorious history, the future will be with Zend PHP4. It is bundled with Apache1.3.12 and MySQL, and they form a strong combination.
We will focus our efforts on making Apache more versatile and adding some improvements to the PHP4. PHP4 has been strong since Beta 2, and it will be the final beta phase and released 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
Here you 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 allow MySQL to start up and run. You probably want to start it at boot time and modify it. To keep MySQL in the boot fashion, you must put the following lines in the file specified below.
./safe_mysqld >/dev/null &
For systems based on Redhat Linux, you need to put these lines in the/etc/rc.d/rc.local, and for a Debian gnu/linux system, you need to put it in/etc/init.d/rcs.
Next we're going to install Apache. Typically, when you upgrade from the existing Apache version, you just need to upgrade without messing with httpd.conf, but because we will support it with the dynamic shared object DSO, you will be moving the current httpd.conf to Httpd.conf.save and using the new Http.conf.default.
Cd/usr/local/apache/conf
MV Httpd.conf Httpd.conf.save
CP Httpd.conf.default httpd.conf
Now go back to the 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
This compiles Apache. Now you have the DSO support, so if you're upgrading, you just need to compile Apache instead of 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
Now compile and install PHP as well as what we need. We have to work with our configuration files.
CP Php.ini-dist/usr/local/apache/conf/php.ini
Cd/usr/local/apache/conf
Edit your httpd.conf. You should only do a few things, unless you need to do something else. First you will be assured that your configuration file supports all PHP modules and other modules. You should see some lines 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, look at the new Httpd.conf.default they should have. Make sure it also has PHP settings, if not, add the above line. Next in the httpd.conf, make sure you build the PHP processor and mime. It should look like this, you have to remove the annotation:
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 release and has only 3 optimization features.
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 profile-php.ini and add the following 2 lines without extra spaces and other items in the line:
Zend_optimizer.optimization_level=1
zend_extension= "/usr/local/zend/lib/zendoptimizer.so"
After you have fully edited the httpd.conf, start Apache and check to see if 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 use your browser to look at it, and you should see information about the 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.