title: 403 Forbidden while Calling External PHP in Wordpress
body: <p>I have created a new Page in Wordpress. On this page, I have put the following HTML code:</p>
  
  <pre><code>Please click this &lt;a href="http://sitename.com/blog/wp-content/themes/twentytwelve/statistics.php" title="link"&gt;link&lt;/a&gt; to view the details.
  </code></pre>
  
  <p>statistics.php has the code to query the backend MySQL database, fetch the details and display in a table format.</p>
  
  <p>however, when I click the link on the Wordpress Page I get a 403 forbidden message.</p>
  
  <pre><code>Forbidden
  
  You don't have permission to access /blog/wp-content/themes/twentytwelve/statistics.php on this server.
  
  Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
  </code></pre>
  
  <p>I have tried setting the permissions of the PHP file to both, 644 and 755. Error still persists.</p>
  
  <p>I have even tried putting a simple code like this in the PHP file:</p>
  
  <pre><code>&lt;?php echo "welcome"?&gt;
  </code></pre>
  
  <p>Even then, the same 403 forbidden error.</p>
  
  <p>Now, I have another page on this Wordpress Site. In that page I have an HTML Form that sends a POST request to a PHP file called process.php which is present in the same directory as statistics.php. That page works properly.</p>
  
  <p>So, I tried replacing the URL in my new page from statistics.php to the process.php. That does not give a 403 forbidden error.</p>
  
  <p>Why is it that I am unable to access one PHP file from my wordpress page? Am I allowed to link only to one external PHP file from wordpress page?</p>
  
  <p>both statistics.php and process.php have the same permissions. However, while one page is able to easily access process.php, the other page gives an error for statistics.php.</p>
  
  <p>Help would be much appreciated.</p>
  
  <p>Thanks.</p>