将 PHP 5.5 降级到 5.3



我有一些问题,我没有选择在哪里看。

我已经在 EC2 上安装了一个代码点火器站点,并整理了所有正确的配置,以便站点正常工作。

有一些遗留页面位于 Apache 中同一 www 目录中的单独编码文件中。每个人都有自己的.htaccess文件。

我启用的站点配置如下所示:

<VirtualHost xxx.xx.xx.xxx:80>
    ServerName mysite.com
    ServerAlias www.mysite.*
    #DocumentRoot /home/mysite
    DocumentRoot /home/mysite/sites/production
    ErrorLog /var/log/error_log_mysite
    CustomLog "/var/log/access_log_housebites.log combined
    Alias /blog /home/mysite_blog
    <Directory /home/mysite_blog>
        Options FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

博客.htaccess看起来像这样:

DirectoryIndex index.php
RewriteEngine on
RewriteBase /blog/
RewriteCond $1 !^(index.php|gallery|images|css|js|robots.txt|favicon.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php/$1 [L,QSA]

日志文件中的错误指出:

[Fri Nov 01 19:27:43.091985 2013] [:error] [pid 3953] [client 91.125.181.111:50889] PHP Fatal error:  Call-time pass-by-reference has been removed in /var/www/mysite_blog/wp-content/plugins/flickrpress/flickr.php on line 67

我很确定这是在新服务器上安装 PHP 5.5 的问题,而旧服务器上安装了 5.3。

有没有办法覆盖PHP现在在Ubuntu/Apache上使用5.3?

好吧,你可以做的一件事是修复flickr.php文件,或者至少确保你已经升级到最新版本。来自: PHP 5.4 调用时间传递引用 - 提供简单的修复?

// Wrong way!
myFunc(&$arg);               # Deprecated pass-by-reference argument
function myFunc($arg) { }

用:

// Right way!
myFunc($var);                # pass-by-value argument
function myFunc(&$arg) { }

最新更新