mysql php(編譯版) 安裝
安裝 mysql
#yum -y install mysql mysql-server mysql-devel
啟動 mysql
#service mysqld start
建立 mysql root 帳號的密碼(在這邊密碼設為1234,可自訂)
#mysqladmin -u root password 1234
連線 mysql 並使用密碼
#mysql -u root -p
安裝 php 5.4.8
#wget http://tw2.php.net/get/php-5.4.8.tar.gz/from/tw1.php.net/mirror
#tar zxvf php-5.4.8.tar.gz
#yum -y install libxml2 libxml2-devel
#./configure --prefix=/usr/local/web/php --with-apxs2=/usr/local/web/apache2/bin/apxs --enable-sockets --with-mysql --with-zlib-dir --with-freetype-dir --with-png-dir --with-openssl --enable-mbstring --with-curl --with-gd --with-jpeg-dir --enable-pcntl --enable-pdo --with-pdo-mysql
(依個人需求增減參數)
錯誤訊息
configure: error: Please reinstall the libcurl distribution - easy.h should be in <curl-dir>/include/curl/
解決方式
#yum install curl curl-devel
錯誤訊息
configure: error: jpeglib.h not found.
解決方式
#yum -y install gd gd-devel
整合 apache 和 php
在 /usr/local/web/apache2/conf/httpd.conf 中增加
<IfModule mime_module>
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
</IfModule>
<IfModule dir_module>
DirectoryIndex index.html index.php index.htm
</IfModule>
重新啟動 apache
#apachectl restart
建立 php 頁面測試
#vi /usr/local/web/apache2/htdocs/test.php
<?php
phpinfo();
?>
瀏覽器打開 http://ip/test.php
參考網頁
http://www.frostsky.com/2011/11/php-configure-error/
11/8 新增
設定 mysql 開啟自動啟動
#chkconfig mysqld on
#chkconfig
mysqld 2-5:on 就表示成功
11/19 新增
複製 php.ini-production 並改名成 php.ini
#cp php.ini-production /usr/local/web/php/lib/php.ini
修改時區設定
date.timezone = Asia/Taipei
0 意見:
張貼留言