banner
李大仁博客

李大仁博客

天地虽大,但有一念向善,心存良知,虽凡夫俗子,皆可为圣贤。

A bloodshed caused by a semicolon, CG's blog on WordPress closed for a day.

Title: "A Bloodbath Caused by a Semicolon: CG's Blog Closed for a Day on Wordpress"
Date: "2009-06-08"
Categories:

  • "Blog Skills"
    Tags:
  • "PHP Coding"
  • "Wordpress"

Yesterday, the save failed, but today it finally succeeded. CG has decided to update his own Wordpress. CG has been using version 2.6 of Wordpress, which has been stable, but recently it crashed. CG has already found the cause, but still decided to update.

Recently, CG placed GG's AdSense content on his blog. Because he was not satisfied with the number of user clicks, he decided to modify some settings in the blog. The result was a 500 internal error. CG has encountered this issue multiple times before, and it is usually due to a conflict between the pseudo-static settings and server permissions. This kind of problem is usually resolved by directly contacting the hosting provider's customer service. After sending the message, he waits...

20 minutes later, there is a notification from the hosting provider in the bottom right corner of the desktop, indicating that the pseudo-static has been successfully enabled and the functionality has been restored. CG opens the blog, but it still shows a 500 error. There are no issues with phpinfo(). He thinks that this time it's a big problem.

He restores the backup files from a few days ago and opens it again, but it still shows a 500 error and phpinfo() is not working. It seems that the hosting provider did not enable pseudo-static after the restoration. He continues to contact the hosting provider and waits...

At 22:00 in the evening, everything is restored, and then he modifies the theme of WP again. It works normally and everything is okay.

In the evening, he writes a blog post, but there is a problem with the automatic save, and it still shows a 500 error. FT.

He has always been suspicious if the hosting provider is fooling him. Pseudo-static is not actually enabled. In the morning, he calls their 400 number and gets the following explanation: For server security reasons, they currently do not provide users with open access to pseudo-static functionality. Users need to apply for it themselves, but there will be restrictions on dynamic scripts. If a user engages in illegal operations, it will be closed, resulting in a 500 error on the user's end. Users need to reapply for it to be opened.

Then he submits a support ticket for the third time, waiting... However, this time there is a small incident. CG made a serious mistake and wrote "pseudo-random" instead of "pseudo-static". Oops!

Everything is back to normal.

Afterwards, CG checks and finds that the reason was that he accidentally left out a semicolon when he finished modifying. Because of this PHP error caused by a missing semicolon, the hosting provider usually handles all dangerous PHP errors for server security, resulting in the inability to parse PHP for the entire site, and finally disabling the pseudo-static functionality. Completely speechless.

Finally, let's explain what pseudo-static means. Pseudo-static refers to a website's pages that appear static to users and search engines, with static URLs. However, in reality, the website is dynamically generated. For example, the URL "www.lidaren.com/page/2" is a dynamic PHP page, but users and search engines see it as a static URL. This is user and search engine friendly. No more "?" and "&" to indicate GET requests. This method is also beneficial for SEO. However, there are also disadvantages. This method relies on server technology, and because URL conversion is done on the server side, it consumes more server resources compared to regular URLs. Additionally, because pseudo-static URLs can be self-defined, it can lead to many-to-many page mappings, resulting in server-side infinite loop processing and other issues, posing a threat to server security. Therefore, currently many hosting providers do not support it.

Usually, in Apache's httpd.conf, you can add:

AcceptPathInfo On # Allow obtaining pathinfo

to configure and enable pseudo-static URLs. Other configurations need to be implemented in the server-side software. PHP can use PHP scripts to read and match

$_SERVER['PATH_INFO']

to achieve this.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.