strange behavior - PHP question...

Ryan Schmidt ryandesign at macports.org
Mon Jan 23 02:45:29 PST 2012


On Jan 23, 2012, at 03:40, Phil Dobbin wrote:

> On 23/01/2012 06:35, William H. Magill wrote:
>> A retired sysadmin who has been working with Macports since Darwin days --
>> I am playing with a software package written in php and attempting to learn php in the process.
>> 
>> I have installed (and just recently updated Apache2/Mysql5/php via macports following the instructions
>> at http://trac.macports.org/wiki/howto/MAMP
>> 
>> All on a Mac mini running 10.6.8 - I'm working remotely on the mini from an iMac running 7.2.
>> Both systems are "clean" Apple or Macports, without random software installs.
>> 
>> The only "non-standard-macports-way" I did things was to stick the Apache log files under
>> /var/log so I can read them with "console."  
>> 
>> Everything apparently works well and fine. 
>> All of the "tests" in that document (MMAP) pass with flying colors, including  the "phpinfo.php" test.
>> And phpmyadmin works as expected.
>> The package I am playing with also works fine.
>> 
>> However, when I visit php.net and follow their tutorial, the very first example fails.
>> 
>> <html>
>> <head>
>> <title>PHP Test</title>
>> </head>
>> <body>
>> <?php echo '<p>Hello World</p>'; ?>
>> </body>
>> </html>
> 
> [..]
> 
> Have you uncommented the `LoadModule php5_module
> modules/libphp5.so` at line 117 in httpd.conf?

Yes, he has, since phpinfo.php works.

William, I don't immediately understand why phpinfo.php would work but your hello.php wouldn't work. Try to reduce the number of differences between the files until you either make hello.php work or phpinfo.php fail. For example, put them in the same directory. Or try to replace the content of one of the files with the content of the other file: what happens?

Check the Apache error log. There might also be a separate PHP error log, if you've set it up that way. If you still get a blank page in the browser, see if the View Source command in the browser shows anything. 




More information about the macports-users mailing list