天天看點

LAMP更新

1.apache 更新

新下載下傳apache

提示少apr apr-util pcre

果斷下載下傳最新版,安裝,然後--with- 指定位址

2.啟動apache報錯

根據提示,重裝mysql

重裝陳功

目前重裝php中

各種報錯,

configure: error: mysql configure failed. Please check config.log for more information.

準備更換新版本mysql

沒有更換

根據config.log

configure:59628: gcc -o conftest -I/usr/include -g -O2 -pthread  -D_REENTRANT -Wl,-rpath,/usr/local/mysql//lib/mysql -L/usr/local/mysql//lib/mysql -L/usr/lib  -Wl,-rpath,/usr/local/libxml2/lib -L/usr/local/libxml2/lib -Wl,-rpath,/usr/local/jpeg8//lib -L/usr/local/jpeg8//lib -Wl,-rpath,/usr/local/freetype//lib -L/usr/local/freetype//lib -Wl,-rpath,/usr/local/gd//lib -L/usr/local/gd//lib -Wl,-rpath,/usr/local/libmcrypt//lib -L/usr/local/libmcrypt//lib conftest.c -lmysqlclient_r  -lmcrypt -lltdl -lgd -lfreetype -ljpeg -lresolv -lm -ldl -lnsl  -lxml2 -lm -lxml2 -lm 1>&5

/usr/bin/ld: cannot find -lltdl

collect2: ld returned 1 exit status

configure: failed program was:

#line 59617 "configure"

#include "confdefs.h"

/* Override any gcc2 internal prototype to avoid an error.  */

/* We use char because int might match the return type of a gcc2

   builtin and then its argument prototype would still apply.  */

char mysql_close();

int main() {

mysql_close()

; return 0; }

configure:59851: checking for mysql_error in -lmysqlclient_r

configure:59870: gcc -o conftest -I/usr/include -g -O2 -pthread  -D_REENTRANT -Wl,-rpath,/usr/local/mysql//lib/mysql -L/usr/local/mysql//lib/mysql -L/usr/lib  -Wl,-rpath,/usr/local/libxml2/lib -L/usr/local/libxml2/lib -Wl,-rpath,/usr/local/jpeg8//lib -L/usr/local/jpeg8//lib -Wl,-rpath,/usr/local/freetype//lib -L/usr/local/freetype//lib -Wl,-rpath,/usr/local/gd//lib -L/usr/local/gd//lib -Wl,-rpath,/usr/local/libmcrypt//lib -L/usr/local/libmcrypt//lib -Wl,-rpath,/usr -L/usr conftest.c -lmysqlclient_r  -lz -lmcrypt -lltdl -lgd -lfreetype -ljpeg -lresolv -lm -ldl -lnsl  -lxml2 -lm -lxml2 -lm 1>&5

#line 59859 "configure"

char mysql_error();

mysql_error()

找不到-lltdl  

找到libltdl檔案夾

find / -name libltdl

./configure  -enable-ltdl-install

make

make install

然後

進入php檔案夾

執行

./configure --prefix=/usr/local/php/ --with-config-file-path=/usr/local/php/etc/ --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql/ --with-libxml-dir=/usr/local/libxml2/ --with-jpeg-dir=/usr/local/jpeg8/ --with-freetype-dir=/usr/local/freetype/ --with-gd=/usr/local/gd/ --with-mcrypt=/usr/local/libmcrypt/ --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-soap --enable-mbstring=all --enable-sockets

沒問題

make報錯

ext/standard/.libs/info.o: In function `php_info_print_table_header':

/download/LAMP/php-5.2.6/ext/standard/info.c:879: undefined reference to `ts_resource_ex'

ext/standard/.libs/info.o: In function `php_info_print_table_row_internal':

/download/LAMP/php-5.2.6/ext/standard/info.c:923: undefined reference to `ts_resource_ex'

ext/standard/.libs/info.o: In function `php_print_gpcse_array':

/download/LAMP/php-5.2.6/ext/standard/info.c:133: undefined reference to `executor_globals_id'

ext/standard/.libs/info.o: In function `php_info_write_wrapper':

/download/LAMP/php-5.2.6/ext/standard/info.c:67: undefined reference to `ts_resource_ex'

ext/standard/.libs/info.o: In function `php_print_info':

/download/LAMP/php-5.2.6/ext/standard/info.c:747: undefined reference to `executor_globals_id'

/download/LAMP/php-5.2.6/ext/standard/info.c:750: undefined reference to `executor_globals_id'

/download/LAMP/php-5.2.6/ext/standard/info.c:753: undefined reference to `executor_globals_id'

/download/LAMP/php-5.2.6/ext/standard/info.c:756: undefined reference to `executor_globals_id'

/download/LAMP/php-5.2.6/ext/standard/info.c:680: undefined reference to `sapi_globals_id'

/download/LAMP/php-5.2.6/ext/standard/info.c:468: undefined reference to `sapi_globals_id'

/download/LAMP/php-5.2.6/ext/standard/info.c:659: undefined reference to `sapi_globals_id'

make: *** [sapi/cli/php] 錯誤 1

正在找解決辦法

make clean

Build complete.

Don't forget to run 'make test'.

make install

應該是成功了

[root@localhost php-5.2.6]# /usr/local/apache2/bin/apachectl start

httpd: Syntax error on line 57 of /etc/httpd/httpd.conf: Cannot load modules/libphp5.so into server: /usr/local/apache2/modules/libphp5.so: undefined symbol: unixd_config

apache啟動發生錯誤

1.http2.2.* 不能直接更新到2.4.1,需要先停止apache,将http.conf 改名成http.conf-2.2.*

2.http2.4.1 目前不再支援php5.2.* 可用的php為5.3.10

php5.2* 會報 httpd: Syntax error on line 163 of httpd.conf: Cannot load modules/libphp5.so into server: modules/libphp5.so: undefined symbol: unixd_config

apache版本2.4.6

php版本5.2.6

下載下傳最新版php PHP-5.5.3.tar.gz

報錯

checking for T1lib support... no

checking whether to enable truetype string function in GD... no

checking whether to enable JIS-mapped Japanese font support in GD... no

If configure fails try --with-vpx-dir=<DIR>

checking for jpeg_read_header in -ljpeg... yes

configure: error: png.h not found.

重新編譯安裝 libpng  嘗試指定目錄 --with-png-dir=/usr/local/libpng/

繼續報錯 configure: error: Unable to find libgd.(a|so) >= 2.1.0 anywhere under /usr/local/gd/

重裝GD庫

./configure --prefix=/usr/local/gd --with-png=/usr/local/libpng/ --with-jpeg=/usr/local/jpeg8/ --with-freetype=/usr/local/freetype/

GD庫重裝成功

嘗試重裝PHP

依然報錯

查找到libgd.*位置

複制到/usr/local/gd/

依然找不到。

找到原因,GD庫版本過低,低于2.1.0 下載下傳最新版本

./configure --prefix=/usr/local/gd --with-jpeg=/usr/local/jpeg8/ --with-freetype=/usr/local/freetype/ --with-png=/usr/local/libpng/

make && make install

成功

[root@localhost php-5.5.3]#  ./configure --prefix=/usr/local/php/ --with-config-file-path=/usr/local/php/etc/ --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql/ --with-libxml-dir=/usr/local/libxml2/ --with-jpeg-dir=/usr/local/jpeg8/ --with-freetype-dir=/usr/local/freetype/ --with-gd=/usr/local/gd/ --with-png-dir=/usr/local/libpng/ --with-mcrypt=/usr/local/libmcrypt/ --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-soap --enable-mbstring=all --enable-sockets

無報錯

/download/LAMP/php-5.5.3/ext/gd/gd.c:57:22: 錯誤:X11/xpm.h:沒有那個檔案或目錄

下載下傳libxpm  解壓 移動位置到/usr/local/libxpm

添加 --with-libXpm-dir=/usr/local/libxpm

失敗

使用yum install libXmp-devel

重裝GD庫,支援Xmp

PHP去掉 --with-libXpm-dir=/usr/local/libxpm

重新開機後,/usr/local/apache2/bin/apachectl start

httpd: Syntax error on line 58 of /etc/httpd/httpd.conf: Could not open config directory /usr/local/apache2/conf.d: No such file or directory

建立conf.d後,

删除apache 所有檔案夾 /etc/httpd /var/www /usr/local/apache2

重新安裝,成功

PHP重新編譯安裝

下一篇: 利用×××lamp

繼續閱讀