Linux version: Ubuntu 12.04
The PHP MySQL and Apache configuration was completed today
is mainly the source code configuration,
Apache is mainly version 2.4.2
PHP is mainly 5.3.11 version
MySQL is mainly 5.1.62 version
Several days ago tried several times, there is a source of software conflict, I put two sources in the same source, after the modification, 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 LIBXML2 to the latest version on Ubuntu and 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 hints
I was in the middle of that./configure, and then it was smooth.
Make
Make install
Because you want the configuration file to be copied to the ETC directory
sudo cp/mypath/mysql/etc/my.cnf
[mysqld]# setting defaults to INNODB table, supporting 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
In order for ordinary users to start MySQL give MySQL directory the following permissions
sudo chown-r mysql:mysql/usr/local/mysql
Then, switching to MySQL under the user, found that MySQL started up the
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 the crash?
./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
And then configure a lot of missing components, alas. One for example bz2 and Zlib and ncurses three components added after
Configure immediately succeeded, and then? "Make OK" test problem ...?? No words, but make install.
Ok
You need to configure the 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 the conf/httpd.conf loadmodules php5_modules modules/libphp5.so fill in
AddType application/x-httpd-php. php. html
AddType Application/x-httpd-php-source. Phps
Apache Other configuration information is also written in the httpd.conf file. such as home directory location