PHP Installation Guide Linux two _php tutorial

Source: Internet
Author: User
B> Iv. How to install and configure from RPM packages
In many Linux distributions, Apache, PHP3 and MySQL are bundled, since MySQL itself is distributed in RPM format, so its installation is described above, only the installation and configuration of Apache and PHP are described below. This article is based on Redhat Linux 6.1. The PHP designer does not recommend configuring PHP3 from RPM, but it will solve this problem in PHP4. Because it is cumbersome to reconfigure and install PHP from RPM, the following methods are for informational purposes only.
1. The rpm file you need
In order to reconfigure and compile PHP, you should download the PHP3 source code rpm:php-3.0.12.6.src.rpm. The package can generate the following RPMs:
php-3.0.12-6.i386.rpm php-manual-3.0.12-6.i386.rpm
php-imap-3.0.12-6.i386.rpm php-ldap-3.0.12-6.i386.rpm
php-pgsql-3.0.12-6.i386.rpm
Before installing the new RPM, you should first delete the already PHP package:
Rpm-e php-imap php-ldap php-pgsql php php-manual
recompiling PHP requires the following packages:
Apache Apache-devel
PostgreSQL Postgresql-devel
Mysql-devel
2. Reconfigure, compile, and install PhP3
To install the PHP3 source code package:
Rpm-i php-3.0.12-6.src.rpm
It installs the PHP source code in the/usr/src/redhat directory, enters the directory, configures and compiles according to the following command:
Cd/usr/src/redhat/specs
VI Php.spec
Edit the Php.spec file, locate the%build section, and in the Options section about./configure, add:
With-mysql=/usr

option, which indicates that PHP supports MySQL database.
%build
CD imap-4.5
Make rpm_opt_flags= "$RPM _opt_flags" LNP
Cd..
Autoconf
Cflags= "-fpic"./configure--prefix=/usr
With-apxs=/usr/sbin/apxs
With-config-file-path=/etc/httpd
Enable-safe-mode
With-exec-dir=/usr/bin
With-system-regex
Disable-debug
With-zlib
Enable-debugger
Enable-magic-quotes
With-mysql=/usr
Enable-track-vars
Save the changes and rebuild the RPM package:
Rpm-bb/usr/src/redhat/specs/php.spec
Finally, you can find the corresponding binary RPM packages in the/usr/src/redhat/rpms/i386 directory and reinstall them:
Rpm-i/usr/src/redhat/rpms/i386/*
3. Configuring Httpd.conf and Srm.conf
After installing PHP, you should configure HTTPD to support PHP3 scripts. First edit the/etc/httpd/conf/httpd.conf, find the following two lines, and remove the comment characters in front of them #:
Addmodule mod_php3.c
LoadModule Php3_module modules/libphp3.so
In compiling the/etc/httpd/conf/srm.conf, remove the following line of the comment symbol #:
AddType application/x-httpd-php3. php3
This way, httpd treats files ending with. php3 as php script files.
4. Testing
You can use the above two examples to do the test.
5. Summary
Some Linux publishers, such as Redhat, have bundled the above three packages in their distribution, but PHP's RPM packages initially do not support MySQL databases. In addition, the original MOD_PHP3 or mod_php usage is obsolete, and the new format is libphp3.so, so mod_php3 or mod_php is not included in the Redhat standard binary distribution.
If you want to keep using the latest version of these three software, the top two methods work best.
The above only describes the installation of these three software, you must configure the PHP and MySQL security settings.

http://www.bkjia.com/PHPjc/509172.html www.bkjia.com true http://www.bkjia.com/PHPjc/509172.html techarticle b>. How to install and configure from RPM packages Apache, PhP3, and MySQL are bundled in many Linux distributions, and since MySQL itself is distributed in RPM format, its installation has ...

  • 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.