Magento 1.9.4版本的官方发布说明上,是支持到PHP7.2版本的。大伟哥换了新的阿里云服务器以后,安装的是PHP7.3,当时也有些担心会不会不兼容,但是迁移过来以后,发现各个页面都能正常打开,也就放着不管了。
直到今天,想进Magento后台去修改某项配置,却发现输入管理员用户名和密码之后,页面跳转不正常,打开的页面是空白页,不能正常显示后台内容。这吓了我一跳,难不成真是PHP版本不兼容的问题?
Apache的错误日志显示如下:
sudo tail /var/log/apache2/error.log
Got error 'PHP message: PHP Fatal error: Uncaught Error: Call to undefined function curl_setopt_array() in /var/www/html/xxxxxx.cn/lib/Varien/Http/Adapter/Curl.php:78\nStack trace:\n#0 /var/www/html/xxxxxx.cn/lib/Varien/Http/Adapter/Curl.php(177): Varien_Http_Adapter_Curl->_applyConfig()\n#1 /var/www/html/xxxxxx.cn/app/code/core/Mage/AdminNotification/Model/Feed.php(163): Varien_Http_Adapter_Curl->write('GET', 'http://notifica...', '1.0')\n#2 /var/www/html/xxxxxx.cn/app/code/core/Mage/AdminNotification/Model/Feed.php(83): Mage_AdminNotification_Model_Feed->getFeedData()\n#3 /var/www/html/xxxxxx.cn/app/code/core/Mage/AdminNotification/Model/Observer.php(50): Mage_AdminNotification_Model_Feed->checkUpdate()\n#4 /var/www/html/xxxxxx.cn/app/code/core/Mage/Core/Model/App.php(1374): Mage_AdminNotification_Model_Observer->preDispatch(Object(Varien_Event_Observer))\n#5 /var/www/html/xxxxxx.cn/app/code/core/Mage/Core/Model/App.php(1353): Mage_Core_Model_App->_callObserverMethod(Object(Mage_AdminNotific...'
这不会是curl的锅吧?试着安装一下对应版本的curl:
sudo apt install php7.3-curl Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: php7.3-curl 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 30.7 kB of archives. After this operation, 135 kB of additional disk space will be used. Get:1 http://mirrors.cloud.aliyuncs.com/debian-security buster/updates/main amd64 php7.3-curl amd64 7.3.14-1~deb10u1 [30.7 kB] Fetched 30.7 kB in 0s (110 kB/s) Selecting previously unselected package php7.3-curl. (Reading database ... 41545 files and directories currently installed.) Preparing to unpack .../php7.3-curl_7.3.14-1~deb10u1_amd64.deb ... Unpacking php7.3-curl (7.3.14-1~deb10u1) ... Setting up php7.3-curl (7.3.14-1~deb10u1) ... Creating config file /etc/php/7.3/mods-available/curl.ini with new version Processing triggers for libapache2-mod-php7.3 (7.3.14-1~deb10u1) ... Processing triggers for php7.3-fpm (7.3.14-1~deb10u1) ... NOTICE: Not enabling PHP 7.3 FPM by default. NOTICE: To enable PHP 7.3 FPM in Apache2 do: NOTICE: a2enmod proxy_fcgi setenvif NOTICE: a2enconf php7.3-fpm NOTICE: You are seeing this message because you have apache2 package installed.
我晕,果然是换新服务器后忘记安装并启用php7.3-curl了。现在刷新页面,后台能正常打开了。
至于Magento 1.9.4和php7.3其他不兼容的地方,目前还没有发现。
- 194 阅读
添加新评论