MoonPoint Support Logo

 

Shop Amazon Warehouse Deals - Deep Discounts on Open-box and Used ProductsAmazon Warehouse Deals



Advanced Search
February
Sun Mon Tue Wed Thu Fri Sat
      4
       
2017
Months
Feb


Sat, Feb 04, 2017 10:44 pm

PHP for Apache on OS X El Capitan

If you are running an Apache web server under OS X El Capitan and want to use PHP with Apache, you will need to take some additional steps after you've got Apache running on OS X/macOS. Once you've got Apache working on the system, you can create a .php file, e.g. phptest.php and have the page displayed by your browser if you visit the page, but PHP code within the page won't be executed. E.g., suppose the phptest.php page contains the following code:

<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>PHP Test</title>
</head>

<body>

<h2>A test page</h2>

<?php phpinfo(); ?>

</body>
</html>

If I visit the page using a browser, the HyperText Markup Language (HTML) code on the page will be displayed, e.g. the "A test page" heading will be displayed, but the information that the phpinfo() command would display regarding the PHP settings for a system on which PHP is working won't be displayed. You could also try a simple PHP echo command, e.g. <?php echo "This is the output from a PHP echo command."; ?>, but the output from that command would not be displayed, either.

[ More Info ]

[/os/os-x/apache] permanent link

Valid HTML 4.01 Transitional

Privacy Policy   Contact

Blosxom logo