I've been struggling with this for the past two days, I just can't find the answer - sorry if I post this in the wrong site but this is the best option I could think of.

I have some problems with a site that I troubleshot all the way until they led me to this particular problem. If I want to download a PHP file browsing to its parent directory I'm not able to, something about the file not being found. I can, however, download any other type of file from this site.


In contrast, I can go to another site, browse to the same directory, and I'm able to download any file without problems.


I thought this might be a problem caused by .htaccess restrictions, but I copied the .htaccess file from the working URL to the non working and it still does not work - I don't need to restart apache for this to take effect, do I?

I'm just out of ideas, I tried copying the whole directory from the working site, permissions are the same on both, I don't know what else to try.

Anybody can share out any other idea? If more information is needed please let me know.

Thank you guys!

  • Sorry, why do you want this kind of unrestricted download access? I make an effort to prevent this sort of thing.
    – s_ha_dum
    Jun 14, 2013 at 14:54
  • I really don't want this, but I tracked down my original problem with a plugin to this, my plugin attempts to load a script but it gets a "not found" error, so I tried manually by going to the plugin's directory and I found I cannot download it myself even though I can on another site
    – andrux
    Jun 14, 2013 at 14:57
  • This question was migrated from serverfault.com, although I'm not sure it fits the criteria to be posted there, I'm quite sure my problem has nothing to do with Wordpress... anyone thinks otherwise?
    – andrux
    Jun 14, 2013 at 14:59
  • Ok. The real problem is different from the one you are asking about.
    – s_ha_dum
    Jun 14, 2013 at 14:59
  • 1
    It is a bit of a judgment call but it is plausibly a WordPress server configuration issue, which is OK per the faq (as I read it).
    – s_ha_dum
    Jun 14, 2013 at 15:01

3 Answers 3


If your server is configured correctly, a request to a PHP file is forwarded to the PHP interpreter. It does not play a role if it is accessed directly, via a link or by clicking on it in a directory listing.

I visited both of your URLs. URL 2 shows an error message - an PHP error message. This file has definitely been processed by the PHP interpreter:

Fatal error: Call to undefined function add_action() in /home/nextgenl/public_html/wp-content/plugins/wp-import-txt/wp-import-txt.php on line 24

The first URL redirects to the main script, with the called file as parameter. It seems to be a Rewrite Configuration here. And there you are right, it should take place in your .htaccess.

For my wordpress installation, I use this .htaccess for URL rewriting:

<IfModule mod_rewrite.c>
   RewriteEngine On
   RewriteBase /
   RewriteRule ^index\.php$ - [L]
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteRule . /index.php [L]
  • Thanks for answering, I already tried a working .htaccess - inluding yours - in the root directory of my installation but the problem still happens. The problem is that one of the php files loads another one and it fails, I thought it was a bad file but no, because I copied the file from the working site, do you have any other idea?
    – andrux
    Jun 14, 2013 at 14:25
  • You might want to check your Apache configuration for the directory you deployed the blog to. Try an AllowOverride all to make sure your .htaccess can have an effect.
    – zero0
    Jun 14, 2013 at 14:27
  • Do you think this .htaccess directive could make a difference if I put it inside the plugins directory? I'll give that a try
    – andrux
    Jun 14, 2013 at 14:36
  • nope, it didn't work
    – andrux
    Jun 14, 2013 at 14:57

... my plugin attempts to load a script but it gets a "not found" error, so I tried manually by going to the plugin's directory and I found I cannot download it myself even though I can on another site

This sounds like a permissions problem. Some of your files or directories have owner or group permissions that aren't allowing the file to load. Be aware that what you can see/load directly is not always the same as what the server can load. It depends on how the file is being accessed. It if very difficult to say exactly what is misconfigured though.

I would take a look at the file permissions on the server that works and set the permissions to match on the server that does not work. Your owner and group could well be different though. The Codex has information that will help you get that.

If you don't have access to the server configuration or this doesn't make sense to you, ask your host for help. You can break things-- probably not permanently but it would certainly be stressful.



  • Thanks, that was my first guess at the problem, but the permissions were correct...
    – andrux
    Jun 14, 2013 at 15:24
  • Please pay attention to the owner and group parts. People forget about those components. Permissions are not global. They are connected to the owner and group of the files and the permissions on the folders all the way down the line matter-- folders need to be executable.
    – s_ha_dum
    Jun 14, 2013 at 15:30
  • Owner and Group are correct: dropbox.com/s/uqfhbnxck86rlz3/…
    – andrux
    Jun 14, 2013 at 15:40
  • Ok, this might help in identifying the issue... I mentioned the plugin "loads" a php file and it comes up with "not found", this is the line that uses this php file: dropbox.com/s/94yjvgtnhitmbjv/php-line.txt
    – andrux
    Jun 14, 2013 at 15:44

I solved my problem already, it WAS a permissions issue but not where I thought it would be - I looked for the plugins directory, the plugin directories and files, but I had to go a little back down the directory tree, back to wp-content directory.

Old permissions were 775, I just set them to 755 and it works like a charm now. I wouldn't think it would matter, but it does apparently.

Thanks to everyone that helped me with this question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.