Link to small .php script on drupal page gives 404 I am new to drupal and have a page set up with a bunch of links. When clicked, the links are supposed to open up a php file (player.php, located in the root directory) in a new window. However, all I get is a 404 error. When I try to navigate to the page directly, I also get a 404 error (www.mywebsite.com/player.php). 

If anyone has any suggestions on how to fix this, it would be a great help!
Make sure that your file player.php is in the right location; it should be in your Drupal root -- the same folder that has index.php.  In my test, a php file at the document root was executed correctly if it was readable by the webserver -- it would run even without execute permissions.  chmod 0 player.php gave me an internal server error, not a 404.  You should check your permissions, but this seems to not be the issue.

Is this site using your own web server configuration file, or is it on a shared or managed ISP?  Check to see if there are any rewrite rules that might be getting in the way.

The workarounds from my previous answer, below, should be unnecessary, but I will leave them here in case they may be of interest or help.

A. Put your file in a different location in the file system, and point at it with an alias.

    alias /player /srv/www/player
    &lt;Directory /srv/www/player&gt;
            AllowOverride None
            Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
            Order allow,deny
            Allow from all
    &lt;/Directory&gt;


Put that in your Apache Virtual hosts file. If you cannot edit this file (e.g. on a shared hosting account), then this will not be an option.  If you set up your vhost conf file like this, restart Apache and put your code at /srv/www/player/player.php. Access it from www.mywebsite.com/player/player.php.

B. Instead of using a standard php file, write a Drupal menu.

function mymodule_menu() {
  $items = array();
  $items['player'] = array(
    'title' =&gt; t('Player'),
    'access callback' =&gt; TRUE,
    'page callback' =&gt; '_mymodule_player',
  );
  return $items;
}


Accessing the URL www.mywebsite.com/player will then run the code in the function _mymodule_player.

See: http://api.drupal.org/api/drupal/modules%21system%21system.api.php/function/hook_menu/7