[英]How do you change the default Pear/PECL build folder from /var/tmp?
我正在嘗試在Linux上安裝PECL軟件包,但安裝程序永遠不會超出配置階段。
我的托管服務提供商在/ var / tmp上安裝了一個文件系統,該文件系統阻止文件執行,並導致此錯誤:
root@host [/usr/local/apache/conf/includes]# pecl install pdo
downloading PDO-1.0.3.tgz ...
Starting to download PDO-1.0.3.tgz (52,613 bytes)
.............done: 52,613 bytes
12 source files, building
running: phpize
Configuring for:
PHP Api Version: 20041225
Zend Module Api No: 20060613
Zend Extension Api No: 220060519
building in /var/tmp/pear-build-root/PDO-1.0.3
running: /root/tmp/pear/PDO/configure
checking for egrep... grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking for C compiler default output file name... a.out
checking whether the C compiler works... configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
ERROR: `/root/tmp/pear/PDO/configure' failed
我99%確信問題是您無法在/ var / tmp中執行文件(我在此處復制了一個可執行文件並嘗試對其進行驗證)。 我確信如果讓PECL在其他地方完成其構建工作,則可以使PECL完成,但是我找不到合適的配置設置。
您如何告訴PECL在非默認文件夾中進行構建?
哇,您為什么要從PECL安裝PDO? 從5.1開始,PDO已內置到PHP中。 您正在運行5.0嗎?
如果您運行的是5.1或更高版本,並且缺少PDO,則可能是:
如果為1,則需要從頭重新編譯PHP,或者僅編譯共享模塊並將其復制到正確的位置。
如果為2,則只需安裝操作系統的PDO擴展。 在RHEL和CentOS下,嘗試yum search php-pdo
。 我不知道調用其他發行版的軟件包安裝程序的正確語法,但該軟件包幾乎肯定會包含字符串“ php-pdo”。 (提示:如果從操作系統中獲取PHP,它們可能還會提供常見的PECL軟件包。請嘗試在其存儲庫中搜索“ pecl”。)
最后,如果您運行的是5.0 ...為了這個世界上的一切都很好,請升級! 首先,請通讀PHP手冊中的升級說明 ,以防萬一您偶然使用了舊的行為。
(此外,要重新配置pecl,請嘗試使用pecl config-show
查看可用的設置,然后嘗試使用pecl config-set ...
更改設置。 請勿嘗試為5.0版以上的PHP版本安裝PDO擴展。 .X,這將打破有在頂部甚至有一個大胖子盒上的PECL網站PDO頁 。)
上面的答案可能對用戶有幫助,但對/ tmp目錄遇到“ noexec”問題的用戶沒有幫助。
這是由於無法執行/ tmp目錄中的內容而導致安裝失敗的“配置錯誤無法運行c編譯程序”時如何安裝[程序]的方法:
首先在exec選項打開的情況下重新掛載/ tmp目錄:mount -o,remount,rw,exec / tmp
其次,安裝您的pecl擴展:pecl install [擴展名]
第三,一旦完成,您應該使用以下命令將其設置回'noexec':mount -o,remount,rw,noexec / tmp
在我的情況下,/ tmp是noexec,/ var是可執行文件。
main10:~# mv /tmp/pear /var/tmp
main10:~# ln -s /var/tmp/pear /tmp/pear
它解決了問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.