安裝LAMP環境遇到Sorry, I cannot run apxs

在linux下安裝php時,(我安裝的時5.2.6)phptar.gz壓縮包解壓縮之後。

在分配路徑和關聯擴展包時遇到錯誤如下:

--------------------------------------------------------

Sorry, I cannot run apxs. Possible reasons follow:

1. Perl is not installed
2. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs
3. Apache was not built using --enable-so (the apxs usage page is displayed)

---------------------------------------------------

解決步驟:

1、根據不能run apxs 。cd 到apache的bin目錄下運行./apxs 運行結果

----------------------------------------------------

bash: ./apxs: /replace/with/path/to/perl/interpreter: bad interpreter: No such file or directory

---------------------------------------------------------

2、vim apxs文件 找“/replace/with/path/to/perl/interpreter”關鍵字

  在第一個行 :#!/replace/with/path/to/perl/interpreter -w

  根據perl的安裝目錄 /usr/bin/perl

  修改爲:#! /usr/bin/perl -w

3、運行第一步。或者直接 ./configure ^^^^^

問題解決  



configure 代碼如下:

./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/jpeg6/--with-freetype-dir=/usr/local/freetype/--with-gd=/usr/local/gd2/--with-mcrypt=/usr/local/libmcrypt/--with-mysqli=/usr/local/mysql/bin/mysql_config--enable-soap--enable-mbstring=all--enable-sockets




發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章