Posted by Derrick on Apr 19, 2010 in Computer Problems, Server Problems, Technology, Troubleshooting |
58 comments

After upgrading my PHP to 5.3.2, I received the following error when accessing MediaWiki (1.6.12):
Parse error: syntax error, unexpected T_NAMESPACE, expecting T_STRING in /usr/local/www/apache22/data/wiki/includes/Namespace.php on line 46There are three solutions:
- Downgrade your PHP from 5.3 back to 5.2
- Upgrade your MediaWiki to a newer version.
- Fix the codes.
- Backup your wiki file first.
- Access your webserver and go to the MediaWiki/includes directory.
For example:cd /usr/local/www/apache22/data/wiki/includes
- Edit Namespace.php
nano Namespace.php
- Go to line 46, change the following from:
class Namespace {
to:
class MWNamespace {
Save the file. - Now, let’s create a script:
nano wikifix.sh
Copy and paste the following:
for fl in *.php; do mv $fl $fl.old sed 's/Namespace::/MWNamespace::/g' $fl.old > $fl done
Save the file. - Change the file to executable by:
chmod u+x wikifix.sh
- Search the keyword Namespace:: and replace it by MWNamespace:::
./wikifix.sh
Warning: Don’t run the script twice! - Delete the script.
rm wikifix.sh
No hay comentarios:
Publicar un comentario