PHP source code apache mysql PHP source code compilation use method

Source: Internet
Author: User
Tags php mysql php source code
Linux version: Ubuntu 12.04
The configuration of PHP MySQL and Apache was completed today
Mainly source code configuration,
Apache is mainly 2.4.2 version
PHP is mostly 5.3.11 version
MySQL is mostly 5.1.62 version
A few days ago tried several times, appeared the source conflict of the software, I put two sources in the same source, after the modification, the installation did not appear big problem.
The overall situation is as follows.
The process I completed is as follows:
Apache Configuration:
./configure--prefix=/usr/local/apache/--WITH-LIBXML2--enable-modules
=most--enable-mods-shared=all
Look at this Apache classic example written.
Add the latest version of LIBXML2 on Ubuntu, then everything OK
Make
Make install
Then enter 127.0.0.1 to see it's work!
MySQL configuration:
CD MySQL
sudo./configure–prefix=/usr/local/mysql–with-mysqld-user=mysql
–with-extra-charsets=all–enable-thread-safe-client
Be careful in the./configure configuration, and be careful of the tips
I just spent that in the middle of the/configure, and then it was smooth.
Make
Make install
Because you want to configure the file to be copied to the ETC directory
sudo cp/mypath/mysql/etc/my.cnf
[mysqld]# set Default to INNODB table, support transaction: DEFAULT-STORAGE-ENGINE=INNODB
# Set the default character set UTF-8:
Character-set-server=utf8
Collation-server=utf8_general_ci
Default-character-set=utf8
# MySQL Startup user
User=mysql
[Client]
Default-character-set=utf8
In order for ordinary users to start MySQL to give MySQL directory the following permissions
sudo chown-r mysql:mysql/usr/local/mysql
Then, switch to the MySQL user and find that MySQL has booted up
PS aux | grep mysqld
If there is/usr/local/mysql/bin/... Description starts the Mysql,mysql configuration OK
In
PHP configuration:
The most complex PHP configuration, the key is that the module is a bit more
Configuration and installation time is a bit long, sometimes I think it is freezing it?
./configure--prefix=/usr/local/php \
--WITH-APXS2=/USR/LOCAL/APACHE/BIN/APXS \
--with-mysql-dir=/usr/local/mysql \
--with-mysql-sock=/tmp/mysql.sock \
--with-pdo-mysql=/usr/local/mysql \
--with-mysqli=/usr/local/mysql/bin/mysql_config \
--enable-mod-charset \
--enable-bcmath \
--WITH-BZ2 \
--enable-calendar \
--with-curl \
--with-curlwrappers \
--ENABLE-EXIF \
--ENABLE-FTP \
--WITH-GDBM \
--with-gd=shared \
--WITH-TTF \
--ENABLE-GD-NATIVE-TTF \
--with-gettext \
--WITH-GMP \
--enable-mbstring=all \
--enable-zend-multibyte \
--with-ming=shared \
--enable-sqlite-utf8 \
--ENABLE-SHMOP \
--ENABLE-SOAP \
--enable-sockets \
--ENABLE-SYSVMSG \
--enable-sysvsem \
--ENABLE-SYSVSHM \
--ENABLE-WDDX \
--WITH-XMLRPC \
--with-xsl \
--enable-zip \
--with-zlib \
--enable-discard-path \
--enable-force-cgi-redirect \
--enable-magic-quotes \
--enable-sigchild \
--with-ncurses \
--enable-pcntl
Then configure the lack of a lot of components, alas. One by one fill in for example bz2 and Zlib and ncurses after three components are added
Configure immediately succeeded, and then what? Make OK Test problem ...? No words, but make install
Ok
You need to configure PHP with the
Create a php.ini file.
Write the following configuration:
Error_log =/usr/local/php/php_error.log
Date.timezone = "Asia/shanghai"
Session.save_path = "/tmp"
For conf/httpd.conf modification, fill in loadmodules php5_modules modules/libphp5.so
AddType application/x-httpd-php. php. html
AddType Application/x-httpd-php-source. Phps
Other Apache configuration information is also written in the httpd.conf file. For example, home directory location:

The above introduces the PHP source code apache mysql PHP source code compiled using methods, including the content of the PHP source, I hope that the PHP tutorial interested in a friend helpful.

  • Related Article

    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.