php.ini檔案到底在哪裡?

來源:互聯網
上載者:User
作者:zccst

假如php版本是5.2.x

如果是lamp環境,則php的源檔案php-5.2.x.tar.gz解壓後會有一個php-5.2.x的檔案夾。
在php-5.2.x的檔案夾下進行./configure --prefix=/opt/php5.2, make, make intall,
然後會在/opt/下生產php5.2檔案夾(該檔案夾是運行時需要的)。

安裝成功後,開啟phpinfo檔案。

phpinfo();




屬性:Configuration File (php.ini) Path 裡有php.ini指向的路徑。

但是,進入該路徑,發現跟麼沒有php.ini檔案,那麼php.ini到底在哪呢。

尋找辦法:
退出php5.2檔案夾到上級目錄,然後執行以下尋找命令:
find ./ -name "php.ini*"

尋找結果:(我自己的環境)
./php-5.2.17/php.ini-recommended
./php-5.2.17/php.ini-dist


哦,原來在php-5.2.x解壓後的檔案夾啊。

cp ./php-5.2.17/php.ini-dist php5.2/

重啟Apache

再重新整理phpinfo檔案,即找到自己的php.ini檔案了。

Loaded Configuration File:xxxxxxxxx

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.