因在上面的配置中,我们将环境全部装在“/usr/local/server”下,所以需要先建立目录。输入“sudo mkdir /usr/local/server”回车创建目录。并将目录所属者设置成“xinxueqi.com”,执行命令“sudo chown -R flzhang:flzhang /usr/local/server
接下来就是编译MySQL,在mysql-5.0.45目录下键入“sudo make && make install clean”:
flzhang@flzhang:~/Downloads/mysql-5.0.45$ make && make install clean
成功后如图示:
成功后为了方便就是配置相关的命令了:
首先进入到安装目录:flzhang@flzhang:~/Downloads/mysql-5.0.45$ cd /usr/local/server/mysql
创建配置文件,键入“cp ./share/mysql/my-medium.cnf ./my.cnf”回车。
然后安装默认数据库文件,键入“./bin/mysql_install_db”回车。成功如下所示:
flzhang@flzhang:/usr/local/server/mysql$ ./bin/mysql_install_db
Installing MySQL system tables...
OK
Filling help tables...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/local/server/mysql//bin/mysqladmin -u root password 'new-password'
/usr/local/server/mysql//bin/mysqladmin -u root -h flzhang password 'new-password'
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr/local/server/mysql/ ; /usr/local/server/mysql//bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd mysql-test ; perl mysql-test-run.pl
Please report any problems with the /usr/local/server/mysql//bin/mysqlbug script!
The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
flzhang@flzhang:/usr/local/server/mysql$
checking for PCRE library in /opt/local/ ... not found
./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=<path> option.
flzhang@flzhang:~/Downloads/nginx-1.4.0$
./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=<path> option.
flzhang@flzhang:~/Downloads/nginx-1.4.0$
checking for OpenSSL md5 crypto library ... not found
./configure: error: the HTTP cache module requires md5 functions
from OpenSSL library. You can either disable the module by using
--without-http-cache option, or install the OpenSSL library into the system,
or build the OpenSSL library statically from the source with nginx by using
--with-http_ssl_module --with-openssl=<path> options.
flzhang@flzhang:~/Downloadsnginx-1.4.0$
解决方法:flzhang@flzhang:~/Downloads/nginx-1.4.0$ sudo apt-get install libssl-dev libperl-dev
creating sapi/cli/php.1
creating sapi/fpm/php-fpm.conf
creating sapi/fpm/init.d.php-fpm
creating sapi/fpm/php-fpm.8
creating main/php_config.h
creating main/internal_functions.c
creating main/internal_functions_cli.c
+--------------------------------------------------------------------+
| License: |
| This software is subject to the PHP License, available in this |
| distribution in the file LICENSE. By continuing this installation |
| process, you are bound by the terms of this license agreement. |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point. |
+--------------------------------------------------------------------+
Thank you for using PHP.
flzhang@flzhang:~/Downloads/php-5.3.8$
安装:
flzhang@flzhang:~/Downloads/php-5.3.8$ make && make install
直接OK :
Installing helper programs: /usr/local/server/php/bin/
program: phpize
program: php-config
Installing man pages: /usr/local/server/php/man/man1/
page: phpize.1
page: php-config.1
Installing PEAR environment: /usr/local/server/php/lib/php/
[PEAR] Archive_Tar - installed: 1.3.7
[PEAR] Console_Getopt - installed: 1.3.0
[PEAR] Structures_Graph- installed: 1.0.4
[PEAR] XML_Util - installed: 1.2.1
[PEAR] PEAR - installed: 1.9.4
Wrote PEAR system config file at: /usr/local/server/php/etc/pear.conf
You may want to add: /usr/local/server/php/lib/php to your php.ini include_path
/home/flzhang/Downloads/php-5.3.8/build/shtool install -c ext/phar/phar.phar /usr/local/server/php/bin
ln -s -f /usr/local/server/php/bin/phar.phar /usr/local/server/php/bin/phar
Installing PDO headers: /usr/local/server/php/include/php/ext/pdo/
flzhang@flzhang:~/Downloads/php-5.3.8$