29th mai 2008

Eurêka!

posted in Tips |

I am happy because I solved a problem with one of my WP plugins, which I could not get working (now-reading). The problem was not especially related to this plugin, but it took me hours to understand the cause.

Problem:

When trying to directly load a .php file in the plugin directory, it would redirect me to index.php and WP would show the 404 error page. No problem for .php files included by others.

Concrete example:

When trying to save the options of « Now Reading », the form would be sent to the following file:
/wp-content/plugins/now-reading/admin/options.php
but instead of loading this file, it would load index.php and display a 404 error.

Same thing when trying to add a book, for the following file:
/wp-content/plugins/now-reading/admin/add.php

Explanation:

So what was happening?

I tried to look at my rewrite rules, suspecting a problem with WP rewrite rules, in vain.

It appears that the solution is much simpler: my web host apache server settings are such that you cannot directly load a .php script which has write permission for group members. Same restriction for scripts located in a directory that has write permission for group members.

By comparing the now-reading directory (and subdirectories) with my other plugins’, I found that the permission was 775 instead of 755. And the file permissions were 664 instead of 644.

Solution:

I changed my directory permissions to 755 and file permissions to 644, and… it worked!

Que d’émotions ;)

This entry was posted on jeudi, mai 29th, 2008 at %H:%M and is filed under Tips. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

There is currently one response to “Eurêka!”

Why not let us know what you think by adding your own comment! Your opinion is as valid as anyone elses, so come on... let us know what you think.

  1. 1 On juin 16th, 2009, featheast said:

    This post save me a whole afternoon, thanks.