Source Code for /public/troubleshooting/php-not-working/index.php
<?php
require('../../inc/functions.php');
add_header("Troubleshooting: PHP isn't working");
?>
<p>
If you tried the <a href="/02-hello-world/">Hello World</a> lesson and didn't get the expected result,
there are a few things you can check:
</p>
<ul>
<li>
Check that your file has a <code>.php</code> extension. In some text editors, it's easy to accidentally save a file
as <code>.html</code>, <code>.txt</code> or similar instead. (Make sure you're actually using a text editor, not a
word processor!)
</li>
<li>
Check that PHP is enabled on your server. Many free/cheap hosting plans don't include PHP (e.g. Neocities
can't run PHP code). Some hosts might require you to check a box to enable it. If you manage your own server, you
might meed to install and configure PHP.
<ul>
<li>
(<a href="https://rai.so/vps101-renting-a-slice-of-a-computer-on-the-internet/">If you're looking for a new host,
this guide might help</a>.)
</li>
</ul>
</li>
<li>
If asking for help online, be sure to include:
<ul>
<li>The code from your failing <code>.php</code> file</li>
<li>The full URL of the page</li>
<li>
The way in which it's not-working e.g. 404 error, 500 error, blank page (use View Source to see if it's
<em>really</em> blank), can see PHP code, etc.
</li>
</ul>
</li>
</ul>
<?php
add_footer();
?>