CentOS 安裝eaccelerator PHP加速

來源:互聯網
上載者:User

1.編譯eaccelerator

Warning: Unknown: open_basedir restriction in effect. File() is not within the allowed path(s): (.:/tmp/) in Unknown on line 0
Fatal error: Can’t load /XX/index.php, open_basedir restriction. in Unknown on line 0
出現了很多次這樣的問題了,感覺都無從下手,總覺得與系統和php有關, 今天又出現了, 想來想去都覺得不奇怪, 後面開始重新編譯php, php的擴充都沒編譯,發現設定open_basedir的時候,卻沒有出錯^^^ , 從這個資訊覺得有些可以利用的,把自己方案所需的擴充都安裝進去,重啟apache的時候,卻發現有出現這個錯誤, 把php.ini中設定的擴充一個一個的關閉,開始排查,後面吧eaccelerator注釋掉後,重啟apache並沒有出現錯誤, 定位問題出現eaccelerator, 在用google查了下,發現eaccelerator 0.9.6後的版本跟以前的有些改變,把open_basedir給限制了,這時我們要把限制去掉才行
下載eaccelerator 0.9.6後先不要安裝,解包後找到eaccelerator.c這個檔案,開啟第1156行,這樣的:
if (PG(open_basedir) && php_check_open_basedir(realname TSRMLS_CC)) {
修改成:
if (PG(open_basedir) && php_check_open_basedir(file_handle->filename TSRMLS_CC)) {
修改後在進行編譯,就ok了

phpize
./configure
make

2.安裝

make install
會將eaccelerator編譯到目標路徑

3.設定
拷貝eaccelerator.ini到 /etc/php.d/eaccelerator.ini

extension=”eaccelerator.so”
eaccelerator.shm_size=”16″
eaccelerator.cache_dir=”/tmp/eaccelerator”
eaccelerator.enable=”1″
eaccelerator.optimizer=”1″
eaccelerator.check_mtime=”1″
eaccelerator.debug=”0″
eaccelerator.filter=”"
eaccelerator.shm_max=”0″
eaccelerator.shm_ttl=”0″
eaccelerator.shm_prune_period=”0″
eaccelerator.shm_only=”0″
eaccelerator.compress=”1″
eaccelerator.compress_level=”9″

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.