Jump to content

PHP on OSX 10.4


Recommended Posts

Hi, I'm trying to learn how to get Apache/MySQL/PHP going on my system, following "Build Your Own DataBase-Driven Web Site using PHP & MySQL, 4th Edition". So far, I have been able get MySQL installed and administered, and Apache is up and running. Yet running a test PHP script doesn't work. I'm not sure if I have the right PHP installed on my system,

 

The book says to modify the httpd.config file in a few places. First, it says to enable the LoadModule php5_module by removing the # symbol. Ignoring the fact that the httpd.config file isn't in the location that the book says it should be, there is no such line for php5 in the file - just #LoadModule php_4, which I enabled, along with the later #AddModule php_4 line.

 

Also, the book says to copy the php.ini.default file to a new php.ini file, and modify the mysql.default_socket line to be mysql.default_socket = /tmp/mysql.sock, which I did. It also says to modify the mysqli.default_socket line in the same way; however, there's no such line in my php.ini file.

 

After all this configuration stuff is done, the book says to save the following script:

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <title>Today’s Date</title>
    <meta http-equiv="content-type"
        content="text/html; charset=utf-8"/>
  </head>
  <body>
    <p>Today’s date (according to this web server) is
      <?php

      echo date('l, F dS Y.');

      ?>
    </p>
  </body>
</html>

 

as today.php, save in the /Library/WebServer/Documents folder, and run from the browser as http://localhost/today.php. When I do so, the browser just shows the source code instead of the correctly interpreted script.

 

So, on OS 10.4.11, should I be looking for a different version of PHP, or do I just need help configuring what I have already? Thanks.

 

Oh, and p.s., Personal Web Sharing is turned on.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.