且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从本地主机上的PHP文件访问MySql数据库

更新时间:2022-11-27 12:22:44

只需确保您使用的是有效凭据,如果一切正常,请查看以下内容:

Just make sure that you are using valid credential, If all thing are right then make a look on these:

.htaccess文件错误

如果您在网站上使用.htaccess,则它可能会干扰您试图加载到浏览器中的网页.请仔细检查.htaccess配置.任何语法错误都会导致显示500 Internal Server Error消息,而不是您的网站.

If you are using a .htaccess on your site, it may be interfering with the web page you are trying to load into your browser. Please double check the .htaccess configuration. Any syntax errors will cause a 500 Internal Server Error message to be displayed instead of your website.

要确认配置错误.htaccess是否是500 Internal Server错误的原因,请暂时删除或重命名.htaccess文件,然后尝试重新加载页面.

To confirm whether a misconfiguration .htaccess is the cause of the 500 Internal Server error, either remove or rename the .htaccess file temporarily and then try to reload the page.

另请参阅:

使用.htaccess重写规则 使用.htaccess文件

Using .htaccess rewrite rules Using .htaccess files

PHP编码超时

如果您的PHP脚本建立了外部网络连接,则连接可能会超时.如果尝试了太多连接并超时,则将导致"500 Internal Server Error".为了防止这些超时和错误,您需要确保使用某些超时规则对PHP脚本进行编码.但是,通常很难在连接到数据库或从外部连接到远程资源(例如RSS提要)时捕获超时错误.实际上,它们冻结了脚本,使其无法继续运行.

If your PHP script makes external network connections, the connections may time out. If too many connections are attempted and time out, this will cause a "500 Internal Server Error." To prevent these time outs and errors, you'll want to make sure that PHP scripts be coded with some timeout rules. Typically, however, catching a timeout error when connecting to a database or externally to remote resources (example: RSS feeds) are difficult. They, in effect, freeze the script from continuing to run.

删除任何外部连接都可以提高网站的性能,并减少出现"500 Internal Server Error"的机会.

Removing any external connections can increase both the performance of your website and decrease the chances of you receiving a "500 Internal Server Error."

内部服务器错误500不是客户端或网站/网站错误...