How to compile and use apachemysqlphp source code _ PHP Tutorial-php Tutorial

Source: Internet
Author: User
How to compile and use apachemysqlphp source code. Linux: ubuntu12.04 today, phpmysql and apache are configured mainly in source code. apache is 2.4.2. php is 5.3.11. mysql is 5.1.62. linux: ubuntu 12.04.
The configuration of php mysql and apache is completed today.
Mainly source code configuration,
Apache version 2.4.2
Php versions 5.3.11
Mysql versions 5.1.62

I tried it several times a few days ago and there was a software source conflict. I put two sources in the same source, and after modification, there was no major problem with the installation.
The general situation is as follows.

The process is as follows:
Apache configuration:
./Configure -- prefix =/usr/local/apache/-- with-libxml2 -- enable-modules
= Most -- enable-MoD-shared = all

See what is written in this apache classic instance.
Add the latest version of libxml2 to ubuntu, and then everything is OK.
Make
Make install
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
Focus on the./configure configuration, and be careful with the prompts.
I spent the./configure in the middle, and then it went smoothly.
Make
Make install
Because you want to copy the configuration file to the etc directory
Sudo cp/mypath/mysql/etc/my. cnf
[Mysqld] # set the default value to an INNODB table and support transactions: 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
To enable normal users to start mysql, grant the following permissions to the mysql Directory:
Sudo chown-R mysql: mysql/usr/local/mysql
Then, switch to the mysql User and find that mysql has started
Ps aux | grep mysqld
If there is/usr/local/mysql/bin /... Mysql is started. mysql configuration is OK.

In
Php configuration:
The most complicated configuration is php. The key is that there are a lot of modules.

Configuration and installation take a long time. sometimes I still think it is a dead end?

./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 reported that many components were missing, alas .. Enter bz2, zlib, and ncurses components one by one.
Configure succeeded immediately. what then? Make OK make test has a problem .....?? It's speechless, but make install
OK

You need to configure php.
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"



Modify conf/httpd. conf 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, the main directory location:

Http://www.bkjia.com/PHPjc/325287.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/325287.htmlTechArticlelinux version: ubuntu 12.04 today completed the php mysql and apache configuration is mainly source code configuration, apache is mainly 2.4.2 version php is 5.3.11 version mysql is 5.1.62...

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.