test my PHP from browser

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.
 
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
 
It doesn't matter if MySQL is alive :p

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 :p

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.
 
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
 
I would use your coputers IP for any configuring. As far as getting into the library, i have no idea.

Twister
 
...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.
 
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.
 

Attachments

  • dwmx_test_server.jpg
    dwmx_test_server.jpg
    75.3 KB · Views: 15
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 :))
 
:confused:

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?
 
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.

:)
 
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
 
Back
Top