简体   繁体   English

警告:PHP 启动:无法加载动态库

[英]Warning: PHP Startup: Unable to load dynamic library

I am currently hosting on 1und1.de.我目前在 1und1.de 上托管。 my codes work on localhost but upon uploading it on the shared hosting server i got the following errors:我的代码在本地主机上工作,但在共享托管服务器上上传时,我收到以下错误:

Warning: Unknown: open(C:\xampp\tmp/sess_bnt91ftgq6s4obn2684fud47p5, O_RDWR) failed: No such file or directory (2) in Unknown on line 0
Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (C:\xampp\tmp) in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext/php_bz2.dll' - C:\xampp\php\ext/php_bz2.dll: cannot open shared object file: No such file or directory in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext/php_curl.dll' - C:\xampp\php\ext/php_curl.dll: cannot open shared object file: No such file or directory in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext/php_mbstring.dll' - C:\xampp\php\ext/php_mbstring.dll: cannot open shared object file: No such file or directory in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext/php_exif.dll' - C:\xampp\php\ext/php_exif.dll: cannot open shared object file: No such file or directory in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext/php_gd2.dll' - C:\xampp\php\ext/php_gd2.dll: cannot open shared object file: No such file or directory in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext/php_gettext.dll' - C:\xampp\php\ext/php_gettext.dll: cannot open shared object file: No such file or directory in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext/php_mysql.dll' - C:\xampp\php\ext/php_mysql.dll: cannot open shared object file: No such file or directory in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext/php_mysqli.dll' - C:\xampp\php\ext/php_mysqli.dll: cannot open shared object file: No such file or directory in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext/php_openssl.dll' - C:\xampp\php\ext/php_openssl.dll: cannot open shared object file: No such file or directory in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext/php_pdo_mysql.dll' - C:\xampp\php\ext/php_pdo_mysql.dll: cannot open shared object file: No such file or directory in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext/php_pdo_sqlite.dll' - C:\xampp\php\ext/php_pdo_sqlite.dll: cannot open shared object file: No such file or directory in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext/php_soap.dll' - C:\xampp\php\ext/php_soap.dll: cannot open shared object file: No such file or directory in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext/php_sockets.dll' - C:\xampp\php\ext/php_sockets.dll: cannot open shared object file: No such file or directory in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext/php_sqlite3.dll' - C:\xampp\php\ext/php_sqlite3.dll: cannot open shared object file: No such file or directory in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext/php_xmlrpc.dll' - C:\xampp\php\ext/php_xmlrpc.dll: cannot open shared object file: No such file or directory in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext/php_xsl.dll' - C:\xampp\php\ext/php_xsl.dll: cannot open shared object file: No such file or directory in Unknown on line 0
Warning: Cannot open 'C:\xampp\php\extras\browscap.ini' for reading in Unknown on line 0

What does these errors mean.这些错误是什么意思。 does these errors have something to do with my hosting provider?这些错误是否与我的托管服务提供商有关?

It looks as though you've probably copied your php.ini configuration file directly from your system to your hosting server.看起来您可能已经将php.ini配置文件直接从您的系统复制到您的托管服务器。 Don't do that.不要那样做。 The data in your configuration file is specific to your XAMPP installation;配置文件中的数据特定于您的 XAMPP 安装; this is not appropriate for the web server, and is causing these errors because the files referenced in your configuration do not exist on the server.这不适用于 Web 服务器,并且会导致这些错误,因为您的配置中引用的文件在服务器上不存在。

Sometimes people here are not as they could be...有时这里的人并不像他们应该的那样......

For whatever reason, your php.ini is mis-configured.无论出于何种原因,您的 php.ini 配置错误。

One thing to note that all those missing files are actually Windows files (*.dll) on Linux these would likely be *.so files.需要注意的一件事是,所有这些丢失的文件实际上是 Linux 上的 Windows 文件 (*.dll),这些文件可能是 *.so 文件。 I'm assuming your hosting on a Linux server.我假设您在 Linux 服务器上托管。

First find your php.ini file.首先找到你的 php.ini 文件。 If you have command line access via SSH, you can try running:如果您可以通过 SSH 进行命令行访问,则可以尝试运行:

php --ini

if not you make a simple script, call it test.php like so:如果没有,您可以编写一个简单的脚本,将其命名为 test.php,如下所示:

<?php
phpinfo();
?>

Upload the file and run it, something like:上传文件并运行它,例如:

http://www.yoursite.com/test.php http://www.yoursite.com/test.php

Among the information provided will be the path to php.ini提供的信息包括 php.ini 的路径

Once you find it, one option is to edit it and comment out all those extensions, by putting a ";"找到它后,一种选择是编辑它并注释掉所有这些扩展名,方法是放一个“;” in front of the line.线前。

Another option is to check if the *.so files exist.另一种选择是检查 *.so 文件是否存在。 Look for them under /usr/lib/php.在 /usr/lib/php 下查找它们。 If they exist, edit your php.ini file to have all those extension end in .so instead of .dll如果它们存在,请编辑您的 php.ini 文件,使所有这些扩展名都以 .so 而不是 .dll 结尾

Finally, if they don't exist, you could install them by using apt-get or yum.最后,如果它们不存在,您可以使用 apt-get 或 yum 安装它们。 An example:一个例子:

sudo apt-get install php-mbstring

I had this error locally with this message:我在本地遇到此错误消息:

Warning: Cannot open "\\xampp\\php\\extras\\browscap.ini" for reading in Unknown on line 0警告:无法打开“\\xampp\\php\\extras\\browscap.ini”来阅读第 0 行的 Unknown

By changing this line of php.ini file :通过更改php.ini文件的这一行:

browscap="\xampp\php\extras\browscap.ini"

to this:对此:

browscap="C:\xampp\php\extras\browscap.ini"

the error has gone.错误消失了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM