To actually run your PHP scripts, you need:
a web server which executes your script
to set the file extension to .php, otherwise the web server won't interpret it as such*
to access your .php file via the web server
* Unless you reconfigure it, everything can be configured.
This last one is particularly important. Just double clicking the file will likely open it in your browser using an address such as:
file://C:/path/to/my/file.php
This is completely bypassing any web server you may have running and the file is not getting interpreted. You need to visit the URL of the file on your web server, likely something like:http://localhost/my/file.php
You may also want to check whether you're using short open tags <? instead of <?php and your PHP configuration has turned short open tags off.
No comments:
Post a Comment