1.改 php.ini
register_globals On On
register_long_arrays On
2.改用新的寫法
$_SERVER
$_GET
$_POST
http://www.backup.idv.tw/viewtopic.php? ... 260f1edd51
如果你的網站跟本站一樣....
1. 使用舊版 phpBB
2. 使用 FreeBSD OS
3. 想從 php4.x 升級到 php5.x (因 php4 即將 end of life 了)
轉載自 http://www.php.net/
代碼:
PHP 4 end of life announcement
[13-Jul-2007]
Today it is exactly three years ago since PHP 5 has been released. In those three years it has seen many improvements over PHP 4. PHP 5 is fast, stable & production-ready and as PHP 6 is on the way, PHP 4 will be discontinued.
The PHP development team hereby announces that support for PHP 4 will continue until the end of this year only. After 2007-12-31 there will be no more releases of PHP 4.4. We will continue to make critical security fixes available on a case-by-case basis until 2008-08-08. Please use the rest of this year to make your application suitable to run on PHP 5.
For documentation on migration for PHP 4 to PHP 5, we would like to point you to our migration guide. There is additional information available in the PHP 5.0 to PHP 5.1 and PHP 5.1 to PHP 5.2 migration guides as well.
4. 具備自行從 php4.x 升級到 php5.x 的能力
5. 不想去變動 php.ini 中的設定 (設定 register_long_arrays = On ... php5 效能會變差)
你可以快速的利用下面的指令.... 修改 phpBB 中舊的 php 語法
讓舊版的 phpBB 程式支援 php5.x....
1. 請先備份你的 phpBB 程式
2. 將下列的文字儲存成一個 script 後執行
代碼:
#!/bin/sh
#phpBB 的存放路徑
cd /usr/local/www/data/phpBB2/
/usr/bin/grep -R \$HTTP_ * | /usr/bin/cut -d ":" -f 1 | /usr/bin/sort -u | /usr/bin/xargs -n 1 perl -pi -e 's/\$HTTP_GET_VARS/\$_GET/g'
/usr/bin/grep -R \$HTTP_ * | /usr/bin/cut -d ":" -f 1 | /usr/bin/sort -u | /usr/bin/xargs -n 1 perl -pi -e 's/\$HTTP_POST_VARS/\$_POST/g'
/usr/bin/grep -R \$HTTP_ * | /usr/bin/cut -d ":" -f 1 | /usr/bin/sort -u | /usr/bin/xargs -n 1 perl -pi -e 's/\$HTTP_SERVER_VARS/\$_SERVER/g'
/usr/bin/grep -R \$HTTP_ * | /usr/bin/cut -d ":" -f 1 | /usr/bin/sort -u | /usr/bin/xargs -n 1 perl -pi -e 's/\$HTTP_COOKIE_VARS/\$_COOKIE/g'
3. 舊版 phpBB 就能在 php5.x 下正常運行囉
php5 中 $HTTP_POST_VARS 不能用
前往
- Software
- ↳ CodeCharge Studio
- ↳ CodeCharge
- ↳ DemoCharge
- ↳ SuperPDF
- ↳ 551einv
- ↳ E3進銷存
- 程式語言
- ↳ PHP
- ↳ CodeLobster PHP Edition
- ↳ Yii
- ↳ CodeIgniter
- ↳ Phalcon
- ↳ Symfony
- ↳ FuelPHP
- ↳ Zend Framework 2
- ↳ laravel
- ↳ WordPress
- ↳ ASP.NET/C#
- ↳ ASP/VBScript
- ↳ JSP
- ↳ Java Servlets
- ↳ ColdFusion
- ↳ Perl
- ↳ Java Script
- ↳ jQuery
- ↳ HTML + CSS
- ↳ jQuery
- ↳ nodejs
- ↳ VB6
- ↳ Git
- ↳ App Inventor 2
- ↳ bash
- ↳ C++/ VC/ OpenCV
- ↳ OpenCV
- ↳ go
- ↳ cordova
- ↳ python
- ↳ Xamarin
- ↳ Assembly
- 資料庫
- ↳ MySQL
- ↳ PostgreSQL
- ↳ ORACLE
- ↳ Access
- ↳ SQL Server
- ↳ SQLite
- ↳ MariaDB
- ↳ Mongodb
- 作業系統
- ↳ Linux
- ↳ Ubuntu
- ↳ CentOS
- ↳ Mint
- ↳ Mandriva
- ↳ Debian
- ↳ Red Hat Enterprise Linux
- ↳ Oracle Linux
- ↳ Fedora
- ↳ Kali Linux
- ↳ OpenSUSE
- ↳ Elementary OS
- ↳ Microsoft
- ↳ Server 2008 R2
- ↳ Server 2012 R2
- ↳ Server 2012
- ↳ 8
- ↳ 10
- ↳ System Center 2016
- ↳ NOVELL
- ↳ FreeBSD
- ↳ VMware
- ↳ VirtualBox
- ↳ Mac OS X
- ↳ Solaris
- ↳ iOS
- ↳ Android
- ↳ Cloud
- ↳ OpenStack
- ↳ Docker
- ↳ Proxmox VE
- ↳ CloudReady
- ↳ chrome
- 網頁伺服器
- ↳ apache
- ↳ tomcat
- ↳ nginx
- ↳ IIS
- ↳ JBoss
- ↳ weblogic
- ↳ WebHosting
- 硬體
- ↳ 硬體及週邊
- ↳ RouterOS
- ↳ LEGO NXT
- ↳ Arduino
- ↳ MSP430
- ↳ Raspberry Pi
- ↳ OpenERP
- ↳ Storage
- ↳ Server
- ↳ Brocade
- ↳ MODELS
- ↳ FortiGate
- 軟體
- ↳ sublime
- ↳ LibreNMS