CentOS配置PHP出現You don't have permission to access on this serve

來源:互聯網
上載者:User
之前配置PHP環境的時候,在瀏覽器上輸入 http://192.168.1.124/index.php

遇到了You don't have permission to access on this server的問題

在網上搜了很多的資料,有的說是selinux的原因,把它關掉就可以了(一點都不管用!),

後來,找到了這篇文章的描述:

***********************分割線**************************

“

在CentOS5.3+MySQL 5.0.45 +Apache2.2.3 +PHP5.1.6中運行PHP程式出錯

You don't have permission to access / on this server

裝好apache+php+mysql後,

拷貝一份phpmyadmin過後運行出錯:

You don't have permission to access / on this server

有人說把selinux關掉就好了

而我發現了這個原因和方法:

因為網站執行的許可權,一般要Read from all httpd scripts and the daemon這個許可權。

當系統內經過解壓出來的檔案夾是沒有這個許可權的。

我們要在html/下建立一個目錄(這時會自動分為Read from all httpd scripts and the daemon許可權)

然後把檔案複製一份過來放進去(注意不是剪下,我之前直接把壓縮包解壓進去也是不行的!)

運行試試看吧。


CentOS5.3+MySQL 5.0.45 +Apache2.2.3 +PHP5.1.6(都是系統內建的)






歡迎加入我的公眾號->挨踢男愛學習

  • 聯繫我們

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