# test my PHP  from browser



## othoap (Dec 12, 2002)

should this tell me if my PHP is running on 10.2.2

from a browser I type -  http://localhost/test_php/test.php
the file is:

<html>
<head>
<title>PHP Test</title>
</head>

<body>
<?php phpinfo () 
?>

</body>
</html>

I should see a status page  -  right?


----------



## Gnomo (Dec 12, 2002)

Assuming that apache is running and that test_php is a folder in the document root of your webserver (/Library/Webserver/Documents)...yes that should work.

However, if you just put test_php in your sites folder you will need to type in 127.0.0.1/~username/test_php/test.php

Also, You don't really need to up all the HTML in the php page.  You can just have <? phpinfo(); ?> in the file.  I don't think you would get any errors, but if you do have the html, you might have multiple tags when the page is created.

If the page returns nothing (or in your case a page that says "<?php phpinfo() ?>"  Php hasn't been turned on in Apache.   If that is the case go to http://entropy.ch and read their directions on how to activate php.


----------



## twister (Dec 12, 2002)

you did install PHP right?  

just wondering

Twister


----------



## othoap (Dec 12, 2002)

Yes I have installed mysql and darwin said it's alive

I'm wondering when I "GRANT all privileages" the IP address I used was 192.168.0.2 this is from my router. Should I use 10.0.0.1 or what?

thanks twister


----------



## michaelsanford (Dec 12, 2002)

It doesn't matter if MySQL is alive 

In a word: semicolon *phpinfo();* not *phpinfo()* I forgot that the first time I made a PHP script and it bugged me for hours until I finally caught on 

_Unless_ of course you see what someone mentioned above: the PHP code itself, which means php isn't parsing it when it serves it from Apache. If you're seeing the code displayed, check httpd.conf.


----------



## othoap (Dec 12, 2002)

Thanks  With twister advice I reinstalled PHP and know the browser resolves the PHP info page.  THANK YOU 

Now on to Dreamweaver MX connection scripts. 

Im on OS 10.2.2 running DMX / mysql / PHP, all of my mysql and PHP check out fine. The DB Im trying to connect to is in Library/WebServer/Documents/antiques_php  there is a _mmServerScripts director present. 

I think this is my problem I have tried many variation of the MySQL Server: address with no luck. 

localhost
localhost/~g4
127.0.0.1
192.168.0.2

DMX error read there is no test server on this machine

Any Ideas michaelsanford

Tanks - hanks


----------



## twister (Dec 13, 2002)

I would use your coputers IP for any configuring.  As far as getting into the library, i have no idea.

Twister


----------



## holmBrew (Dec 13, 2002)

...and it just takes a little tweaking to the apache config to get it working.  MySQL is not necessary ot get phpinfo(); to render.

Follow the instructions on this page from Apple: 
http://developer.apple.com/internet/macosx/php.html

Also, you don't need all the opening and closing html junk in your test.php. It can be simplified to just:

<?php phpinfo(); ?>

I would also suggest viewing all the pages you wish to test in the Apache/PHP/MySQL environment and leaving Dreamweaver MX out of the picture.  It _may_ be an OK development tool, but it will not be a good gauge of how you page will really perform on a real web server.


----------



## michaelsanford (Dec 13, 2002)

The DWMX error you are receiving is because you haven't configured a test server properly in your DWMX site configuraiton, it has nothing to do with PHP or MySQL.

A test server is usually a local folder (like /Library/WebServer/Documents) that it can upload the site to to see how it looks etc.

I'm currently working on a project whose test server is /Library/WebServer/Documents/worklink, here's a screenshot of my DWMX Sites for this project. 

Note that the Access URL is _NOT_ where the site is uploaded to; you have to set that in Testing Server Folder. It is also not the place the site is uploaded to when it is deployed, that's Remote Info.

This also assumes that you are either testing this site from your own hard drive, or have LAN access to the server that is. Otherwise, the configuration will be a little different.


----------



## michaelsanford (Dec 13, 2002)

PS the question mark must come immediately after the opening angle bracket, not after the "php".

You have to tell Apache that something's coming that it can't interpret as HTML (the <? part) then the php part after the ? tells Apache which module to use (i.e., XML, PHP, etc).

(Probably a typo )


----------



## MacLuv (Dec 14, 2002)

I'm still having difficulty getting my basic config setup. I installed PHP with no troubles. When I turn on Apache through filesharing and connect to my local host with a browser, the index page is served up just fine. 

I threw the PHP test page in there, but it doesn't parse it... it just returns the text. When I look in "top" in terminal I just see 5 different httpd listings--are those related?


----------



## MacLuv (Dec 14, 2002)

Okay, my bad. 

When I initially installed PHP, I was doing it during the time I was installing mySQL, and I forgot that when I tried to invoke(?) php, I didn't have Apache turned on.

php is up and works fine.


----------



## mkwan (Apr 14, 2003)

greetings:

I want to make a simple guestbook(or something similar) using flash with php connection to mySQL.  I don't know how to do it on my computer(specs below).  Is there some tutorial site or  something that will help me?

thanks alot

I have Studio MX, mySQL and php enabled


----------

