Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 24th, 2005, 09:16 AM
Registered User
 
Join Date: Apr 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem with PHP on Apache2 OS X

I too purchased the PHP, MySQL, Apache2 training book. I installed PHP, MySQL, Apache2 on my OSX box running 10.3.9. Used the pkg installers and all went well, it seems. I created the test script phpinfo to see if PHP was installed correctly. When I look at it in the browser it returns my script only not the PHP Info. The script is run on :
http://127.0.0.1/phptest.php

and it returns this to the browser, which is identical to the script.

<?php phpinfo(); ?>



I reinstalled everything and still no information is displayed.
I am using OSX 10.3.9, Apache 2.0.52, PHP 5.0.4

Thanks for your assistance.
 
Old April 25th, 2005, 10:55 AM
Registered User
 
Join Date: Apr 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

OMG I actually was able to find the required information to fix this. I am passing along so if anyone else encounters this.

The solution came from searching archives, one particularly koflerappache. Evidentally what the pkg installers does not do is set the httpd configuration for PHP automatically. I made the following changes to my httpd.conf file (Note use the path to your modules) and restarted Apache2 and the script worked correctly to show me my PHPINFO.

change Apache's httpd.conf to make it use PHP

    adds the following line to /usr/local/apache2/conf/httpd.conf:

     LoadModule php5_module modules/libphp5.so

   however, you have to add another line:

     AddType application/x-httpd-php .php

To test it:

   restart Apache

     /usr/local/apache2/bin/apachectl start
     /usr/local/apache2/bin/apachectl stop

   create the file
     /usr/local/apache2/htdocs/test.php
   with this content
     <?php phpinfo(); ?>

   load the page with your web browser
     http://localhost/test.php






Similar Threads
Thread Thread Starter Forum Replies Last Post
SIMPLEST possible php install on Mac OS 10.5 Govinda Beginning PHP 1 August 20th, 2008 11:04 PM
how can i instool and run php on apple os basimshahin MySQL 0 August 24th, 2006 05:36 AM
Apache2 Maedhros ~V~ Beginning PHP 11 November 18th, 2005 03:12 AM
Help with setting up PHP with apache2 on windows mfowler Beginning PHP 3 November 5th, 2003 09:16 AM
JRun4 for Mac OS + Mac OS X's Java 1.4.1 elbicho J2EE 0 June 27th, 2003 12:18 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.