php - PHP 7.4 出现错误,无法在 Windows 上加载动态库
问题描述
我正在尝试在 PHP Moodle 网站上运行 cron 作业
我创建了脚本文件并创建了包含以下内容的 .bat 文件
C:/xampp2/php/php.exe C:/xampp2/htdocs/training/admin/cli/cron.php
然后我尝试使用 cmd 运行它,但出现以下错误
C:\Users\amira>C:\xampp2\htdocs\training\cron.bat
C:\Users\amira>C:/xampp2/php/php.exe C:/xampp2/htdocs/training/admin/cli/cron.php
PHP Warning: Failed loading Zend extension 'opcache' (tried: C:\Program Files (x86)\Plesk\Additional\PleskPHP74\ext\opcache (The specified module could not be found.), C:\Program Files (x86)\Plesk\Additional\PleskPHP74\ext\php_opcache.dll (The specified module could not be found.)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'curl' (tried: C:\Program Files (x86)\Plesk\Additional\PleskPHP74\ext\curl (The specified module could not be found.), C:\Program Files (x86)\Plesk\Additional\PleskPHP74\ext\php_curl.dll (The specified module could not be found.)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'fileinfo' (tried: C:\Program Files (x86)\Plesk\Additional\PleskPHP74\ext\fileinfo (The specified module could not be found.), C:\Program Files (x86)\Plesk\Additional\PleskPHP74\ext\php_fileinfo.dll (The specified module could not be found.)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'gd2' (tried: C:\Program Files (x86)\Plesk\Additional\PleskPHP74\ext\gd2 (The specified module could not be found.), C:\Program Files (x86)\Plesk\Additional\PleskPHP74\ext\php_gd2.dll (The specified module could not be found.)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'gettext' (tried: C:\Program Files (x86)\Plesk\Additional\PleskPHP74\ext\gettext (The specified module could not be found.), C:\Program Files (x86)\Plesk\Additional\PleskPHP74\ext\php_gettext.dll (The specified module could not be found.)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'imap' (tried: C:\Program Files (x86)\Plesk\Additional\PleskPHP74\ext\imap (The specified module could not be found.), C:\Program Files (x86)\Plesk\Additional\PleskPHP74\ext\php_imap.dll (The specified module could not be found.)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'mbstring' (tried: C:\Program Files (x86)\Plesk\Additional\PleskPHP74\ext\mbstring (The specified module could not be found.), C:\Program Files (x86)\Plesk\Additional\PleskPHP74\ext\php_mbstring.dll (The specified module could not be found.)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'exif' (tried: C:\Program Files (x86)\Plesk\Additional\PleskPHP74\ext\exif (The specified module could not be found.), C:\Program Files (x86)\Plesk\Additional\PleskPHP74\ext\php_exif.dll (The specified module could not be found.)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'mysqli' (tried: C:\Program Files (x86)\Plesk\Additional\PleskPHP74\ext\mysqli (The specified module could not be found.), C:\Program Files (x86)\Plesk\Additional\PleskPHP74\ext\php_mysqli.dll (The specified module could not be found.)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'openssl' (tried: C:\Program Files (x86)\Plesk\Additional\PleskPHP74\ext\openssl (The specified module could not be found.), C:\Program Files (x86)\Plesk\Additional\PleskPHP74\ext\php_openssl.dll (The specified module could not be found.)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_mysql' (tried: C:\Program Files (x86)\Plesk\Additional\PleskPHP74\ext\pdo_mysql (The specified module could not be found.), C:\Program Files (x86)\Plesk\Additional\PleskPHP74\ext\php_pdo_mysql.dll (The specified module could not be found.)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_sqlite' (tried: C:\Program Files (x86)\Plesk\Additional\PleskPHP74\ext\pdo_sqlite (The specified module could not be found.), C:\Program Files (x86)\Plesk\Additional\PleskPHP74\ext\php_pdo_sqlite.dll (The specified module could not be found.)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'sockets' (tried: C:\Program Files (x86)\Plesk\Additional\PleskPHP74\ext\sockets (The specified module could not be found.), C:\Program Files (x86)\Plesk\Additional\PleskPHP74\ext\php_sockets.dll (The specified module could not be found.)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'sodium' (tried: C:\Program Files (x86)\Plesk\Additional\PleskPHP74\ext\sodium (The specified module could not be found.), C:\Program Files (x86)\Plesk\Additional\PleskPHP74\ext\php_sodium.dll (The specified module could not be found.)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'sqlite3' (tried: C:\Program Files (x86)\Plesk\Additional\PleskPHP74\ext\sqlite3 (The specified module could not be found.), C:\Program Files (x86)\Plesk\Additional\PleskPHP74\ext\php_sqlite3.dll (The specified module could not be found.)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'xsl' (tried: C:\Program Files (x86)\Plesk\Additional\PleskPHP74\ext\xsl (The specified module could not be found.), C:\Program Files (x86)\Plesk\Additional\PleskPHP74\ext\php_xsl.dll (The specified module could not be found.)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'sqlsrv_74_nts_x64' (tried: C:\Program Files (x86)\Plesk\Additional\PleskPHP74\ext\sqlsrv_74_nts_x64 (The specified module could not be found.), C:\Program Files (x86)\Plesk\Additional\PleskPHP74\ext\php_sqlsrv_74_nts_x64.dll (The specified module could not be found.)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_sqlsrv_74_nts_x64' (tried: C:\Program Files (x86)\Plesk\Additional\PleskPHP74\ext\pdo_sqlsrv_74_nts_x64 (The specified module could not be found.), C:\Program Files (x86)\Plesk\Additional\PleskPHP74\ext\php_pdo_sqlsrv_74_nts_x64.dll (The specified module could not be found.)) in Unknown on line 0
!!! <p>Error: database driver problem detected</p>
<p>The site administrator should verify server configuration</p><p>PHP has not been properly configured with the MySQLi extension for it to communicate with MySQL. Please check your php.ini file or recompile PHP.</p> !!!
我检查了我的 php.ini 文件,我已经包含了扩展
[PHP_MYSQLI]
extension=php_mysqli.dll
[PHP]
cgi.force_redirect = 0
cgi.fix_pathinfo = 1
fastcgi.impersonate = 1
fastcgi.logging = 0
extension=php_intl.dll
extension=php_xmlrpc.dll
extension=php_soap.dll
extension=php_ldap.dll
extension=intl
extension=php_fileinfo.dll
intl.default_locale = en_utf8
extension=php_intl.dll
[opcache]
zend_extension = php_opcache.dll
opcache.enable = 1
opcache.memory_consumption = 128
opcache.max_accelerated_files = 10000
opcache.revalidate_freq = 60
; Required for Moodle
opcache.use_cwd = 1
opcache.validate_timestamps = 1
opcache.save_comments = 1
opcache.enable_file_override = 0
max_input_vars = 10000
有人可以帮忙吗?
解决方案
推荐阅读
- php - 是否可以扩展 woocommerce 产品休息端点?
- windows - Git status 在 cygwin 和 git bash (windows 10) 中给出不同的结果
- flutter - 颤振发布运行 build_runner 构建失败
- next.js - TypeError:无法解构“未定义”或“空”的属性“请求”
- node.js - 日期过滤在 mongoldb 中不起作用
- python-3.x - 如何显示尊重其相对大小的图像?
- android - 解释这个 Bash 脚本
- python - 我想控制卷积神经网络中的步幅,但我不知道如何写步幅
- regex - 验证数据后如何从 xml 文件中获取数据?
- c# - Visual Studio调试在mvc中上传文件时立即停止?