{"id":653,"date":"2010-04-19T11:01:49","date_gmt":"2010-04-19T16:01:49","guid":{"rendered":"http:\/\/75.134.27.61:8101\/wordpress\/?p=653"},"modified":"2011-12-28T15:34:06","modified_gmt":"2011-12-28T21:34:06","slug":"mediawiki-error-parse-error-syntax-error-unexpected-t_namespace-expecting-t_string-in-usrlocalwwwapache22datawikiincludesnamespace-php-on-line-46","status":"publish","type":"post","link":"https:\/\/icesquare.com\/wordpress\/mediawiki-error-parse-error-syntax-error-unexpected-t_namespace-expecting-t_string-in-usrlocalwwwapache22datawikiincludesnamespace-php-on-line-46\/","title":{"rendered":"MediaWiki Error: &#8220;Parse error: syntax error, unexpected T_NAMESPACE, expecting T_STRING in \/usr\/local\/www\/apache22\/data\/wiki\/includes\/Namespace.php  on line 46&#8221;"},"content":{"rendered":"<p><br \/>\nAfter upgrading my PHP to 5.3.2, I received the following error when accessing MediaWiki (1.6.12):<\/p>\n<pre>\r\nParse error: syntax error, unexpected T_NAMESPACE, expecting T_STRING in \/usr\/local\/www\/apache22\/data\/wiki\/includes\/Namespace.php  on line 46\r\n<\/pre>\n<p>There are three solutions:<\/p>\n<ol>\n<li>Downgrade your PHP from 5.3 back to 5.2<\/li>\n<li>Upgrade your MediaWiki to a newer version.<\/li>\n<li>Fix the codes.<\/li>\n<\/ol>\n<p>In my case, the first couple solutions do not work for me, and therefore I choose 3.<\/p>\n<ol>\n<li>Backup your wiki file first.<\/li>\n<li>Access your webserver and go to the MediaWiki\/includes directory.<br \/>\nFor example:<\/p>\n<pre>cd \/usr\/local\/www\/apache22\/data\/wiki\/includes<\/pre>\n<\/li>\n<li>Edit <strong>Namespace.php<\/strong>\n<pre>nano Namespace.php<\/pre>\n<\/li>\n<li>Go to line 46, change the following from:\n<pre>class Namespace {<\/pre>\n<p>to:<\/p>\n<pre>class MWNamespace {<\/pre>\n<p>Save the file.<\/li>\n<li>Now, let&#8217;s create a script:\n<pre>nano wikifix.sh<\/pre>\n<p>Copy and paste the following:<br \/>\n<\/p>\n<pre>for fl in *.php; do\r\nmv $fl $fl.old\r\nsed 's\/Namespace::\/MWNamespace::\/g' $fl.old &gt; $fl\r\ndone<\/pre>\n<p>Save the file.<\/li>\n<li>Change the file to executable by:\n<pre>chmod u+x wikifix.sh<\/pre>\n<\/li>\n<li>Search the keyword <strong>Namespace::<\/strong> and replace it by <strong>MWNamespace::<\/strong>:\n<pre>.\/wikifix.sh<\/pre>\n<p><strong>Warning: Don&#8217;t run the script twice!<\/strong><\/li>\n<li>Delete the script.\n<pre>rm wikifix.sh<\/pre>\n<\/li>\n<\/ol>\n<p>Try to access the MediaWiki again and the problem should be gone.<\/p>\n<p>Enjoy Wiki.<\/p>\n<p>&#8211;Derrick<\/p>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 46 There are <a class=\"more-link\" href=\"https:\/\/icesquare.com\/wordpress\/mediawiki-error-parse-error-syntax-error-unexpected-t_namespace-expecting-t_string-in-usrlocalwwwapache22datawikiincludesnamespace-php-on-line-46\/\">Continue Reading &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[94,144,6,69],"tags":[68,172,33],"class_list":["post-653","post","type-post","status-publish","format-standard","hentry","category-computer-problems-computer-help-pc-support","category-sever-problem","category-technology","category-troubleshooting-technology","tag-mediawiki","tag-php","tag-troubleshooting"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/p1sqzr-ax","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":3539,"url":"https:\/\/icesquare.com\/wordpress\/freebsdshared-object-libaprutil-1-so-5-not-found-required-by-httpd\/","url_meta":{"origin":653,"position":0},"title":"[FreeBSD]Shared object &#8220;libaprutil-1.so.5&#8221; not found, required by &#8220;httpd&#8221;","author":"Derrick","date":"June 11, 2014","format":false,"excerpt":"I upgraded the Apache to 2.2.27 on my FreeBSD box via portmaster. The upgrade went very smooth. After the upgrade, I decide to test the Apache by restarting the server. Oh well, I got the following error message: [FreeBSD]Shared object \"libaprutil-1.so.5\" not found, required by \"httpd\" Oh well, looks like\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1561,"url":"https:\/\/icesquare.com\/wordpress\/apache-wont-start-after-upgrading-to-2-2-21-in-freebsd-8-2\/","url_meta":{"origin":653,"position":1},"title":"Apache won&#8217;t start after upgrading to 2.2.21 in FreeBSD 8.2","author":"Derrick","date":"September 15, 2011","format":false,"excerpt":"Apache 2.2.21 was rolled out today. Since it has some security fixes, I decide to put a new version on my server farm. I didn't know that it becomes a small headache today morning. The upgrade was running smooth, no error messages, no complaints, until I restart the Apache server\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"\/wordpress\/wp-content\/uploads\/2011\/09\/connectionReset.png","width":350,"height":200,"srcset":"\/wordpress\/wp-content\/uploads\/2011\/09\/connectionReset.png 1x, \/wordpress\/wp-content\/uploads\/2011\/09\/connectionReset.png 1.5x"},"classes":[]},{"id":3925,"url":"https:\/\/icesquare.com\/wordpress\/freebsdupgrade-php-5-5-to-5-6\/","url_meta":{"origin":653,"position":2},"title":"[FreeBSD]Upgrade PHP 5.5 to 5.6","author":"Derrick","date":"February 20, 2015","format":false,"excerpt":"It is not easy to upgrade PHP 5.5 to 5.6 in FreeBSD. Without proper preparation, the upgrade process may drive you nut. Before you decide to get your hands wet, here are what I recommend you to do: Back up your files Test your website in a PHP 5.6 environment\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":31,"url":"https:\/\/icesquare.com\/wordpress\/installing-apache-php-mysql-and-memcached-on-freebsd\/","url_meta":{"origin":653,"position":3},"title":"Installing Apache, PHP, MySQL and MemCached on FreeBSD","author":"Derrick","date":"May 19, 2009","format":false,"excerpt":"This is my note on how to to install Apache, PHP, MySQL and MemCached on a FreeBSD 7 Box. 1. MySQL Go to the mysql52-server port directory by typing the command: cd \/usr\/ports\/databases\/mysql51-server Build the port by typing: make BUILD_OPTIMIZED=yes BUILD_STATIC=yes Using these two options will speed up the execution\u2026","rel":"","context":"In &quot;FreeBSD&quot;","block_context":{"text":"FreeBSD","link":"https:\/\/icesquare.com\/wordpress\/category\/sever-problem\/freebsd\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1489,"url":"https:\/\/icesquare.com\/wordpress\/php-warning-php-startup-unable-to-load-dynamic-library-usrlocallibphp20090626tokyo_tyrant-so-usrlocallibphp20090626tokyo_tyrant-so-undefined-symbol-ps_globals-in-unknown-on-l\/","url_meta":{"origin":653,"position":4},"title":"PHP Warning:  PHP Startup: Unable to load dynamic library &#8216;\/usr\/local\/lib\/php\/20090626\/tokyo_tyrant.so&#8217; &#8211; \/usr\/local\/lib\/php\/20090626\/tokyo_tyrant.so: Undefined symbol &#8220;ps_globals&#8221; in Unknown on line 0","author":"Derrick","date":"August 23, 2011","format":false,"excerpt":"Every time I upgrade the PHP and related extensions, I always run into the same problem with some PHP-PECL modules. Recently with the new release of PHP 5.3.7, there is no exception for the trouble. So what kind of trouble I have today? The Tokyo Tyrant (The middleman between my\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"\/wordpress\/wp-content\/uploads\/2011\/08\/tokyocabinet.png","width":350,"height":200},"classes":[]},{"id":3596,"url":"https:\/\/icesquare.com\/wordpress\/shared-object-libsqlite3-so-8-not-found\/","url_meta":{"origin":653,"position":5},"title":"Shared object &#8220;libsqlite3.so.8&#8221; not found","author":"Derrick","date":"July 1, 2014","format":false,"excerpt":"I noticed some weird thing on my server today. When I ran some PHP code, I got the following error: PHP Warning: PHP Startup: Unable to load dynamic library '\/usr\/local\/lib\/php\/20121212-zts\/pdo_sqlite.so' - Shared object \"libsqliteo_sqlite.so\" in Unknown on line 0 Warning: PHP Startup: Unable to load dynamic library '\/usr\/local\/lib\/php\/20121212-zts\/pdo_sqlite.so' - Shared\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts\/653","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/comments?post=653"}],"version-history":[{"count":17,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts\/653\/revisions"}],"predecessor-version":[{"id":2396,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts\/653\/revisions\/2396"}],"wp:attachment":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/media?parent=653"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/categories?post=653"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/tags?post=653"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}