問題:
已經安裝了最新的穩定版本的Nginex(1.4.4),并且想安裝phpMyAdmin,不幸的是當我嘗試在我的瀏覽器中通過http:// 192打開phpMyAdmin時出現以下錯誤. . . / phpMyAdmin的:
究竟nginx找不到phpMyAdmin文件的原因是什么?
這是我的/etc/nginx/nginx.conf文件的內容:
立即學習“PHP免費學習筆記(深入)”;
解決方法:
正確的方法是創建一個名為php的文件并添加到/ etc / nginx / sites-available.您可以復制下面的文件,但將端口號更改為其他內容。
server?{ ????????listen?30425; ????????#?Don't?want?to?log?accesses.???????? ????????#access_log??/dev/null?main; ????????access_log??/var/log/nginx/php.acces_log?main; ????????error_log???/var/log/nginx/php.error_log?info; ????????root?/usr/share/phpmyadmin; ????????index??index.php?index.html?index.htm; ????????error_page?401?403?404?/404.php; ????????location?~?.*.php${ ????????????????include?fastcgi_params; ????????????????fastcgi_pass??127.0.0.1:9000; ????????????????fastcgi_index?index.php; ????????????????fastcgi_param??SCRIPT_FILENAME?$document_root$fastcgi_script_name; ????????????????fastcgi_param?SERVER_NAME?$http_host; ????????????????fastcgi_ignore_client_abort?on; ????????}}
現在,您需要對啟用了站點的目錄進行符號鏈接
ln?-s?/?etc?/?nginx?/?sites-available?/?php?//?etc?/?nginx?/?sites-enabled
現在您需要將此代碼添加到nginx.conf的Logging Settings部分
log_format?main?‘$remote_addr?–?$remote_user?[$time_local]?‘ ????????????????‘”$request”?$status?$body_bytes_sent?“$http_referer”?‘ ????????????????‘”$http_user_agent”?“$http_x_forwarded_for”‘?;
現在您可以使用http://example.com:30425訪問您的phpmyadmin。
相關文章教程推薦:phpmyadmin教程
? 版權聲明
文章版權歸作者所有,未經允許請勿轉載。
THE END
喜歡就支持一下吧
相關推薦