Running Your First PHP Script


To run phpinfo.php, just open it in your browser as you would a standard web page that you've uploadedthat is, navigate in a browser to the URL for phpinfo.php, such as http://www.yourisp.com/username/phpinfo.php. If you're using PHP locally, navigate to http://localhost/phpinfo.php after starting your local web server.

NOTE

Do not open phpinfo.php directly in your browser using a menu item such as File > Open because that would open the file without running it through the web server, so the PHP script wouldn't run. Make sure you enter the appropriate URL in the browser's navigation bar instead.


If all is well, you should see a table packed full of information about PHP, as it appears in Figure 1-3 in the browser. Congratulations, you're a PHP developer! There are a number of tables here; it's worthwhile scrolling down to take a look at the information on your PHP configuration. If you're ever in doubt about what your PHP version has installed, this is a good place to check.

Figure 1-3. Results of the first PHP script.




    Spring Into PHP 5
    Spring Into PHP 5
    ISBN: 0131498622
    EAN: 2147483647
    Year: 2006
    Pages: 254

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net