PHP/mySQL difficulties on Mac OS X....

T

The Annoyed Man

Guest
Boy, I hope somebody can help me in some concrete fashion....

First, the background: I am not an expert at installing these things, and I barely understand any of the discussions I've read here, or on other help forums. However, I have been doing simple coding in PHP and using MySQL for a few years now, and I've been running both PHP and MySQL on my home PC for quite a long time without difficulty. I'm not the sharpest programming knife in the drawer, but neither am I completely lost.

My work machine is a dual processor G5, running OS X 10.3.8 with the webserver that is native to the OS running. I have installed PHP version 5.0.3 (www.entropy.ch Release 1) and MySQL 4.0.23-standard. I have also installed phpMyAdmin 2.6.1, and it is running beautifully. I am able to use it to create databases, tables, and records, as well as to edit existing databases, tables, and records; so I know definitively that both PHP and MySQL are working on this machine. HOWEVER....

I cannot get PHP to talk to MySQL in the pages that I write when trying to execute those scripts on my local drive; nor can I get it to execute a simple script such as declaring a variable to equal such and so and then trying to echo the variable in the body, or trying to carry a variable forward from a form to the next page. But, those same pages function just fine when uploaded to the web and running on a hosting webserver.

When I run http://127.0.0.1/~MyComputerName/test.php (which performs the phpinfo() function), it appears to show that everything is running fine. All the PHP files I'm writing are located in subdirectories within the user/sites/ directory, which is where all the documentation I can find says they should be. The fact that phyMyAdmin is running just fine in that directory tells me that I'm doing the right thing.

It would be great if I didn't have to upload each script to check its validity each time I make an edit, and any constructive suggestions would be very much appreciated.

Thank you.
 
OP
T

tj6106

Guest
I had the same problem. Couldn't get it to work at all and ended up installing MAMP (Mac, Apache, Mysql, PHP) to get the whole thing working together. Have you tried to configure your php install with mysql??
 
OP
T

The Annoyed Man

Guest
Sorry it took so long to reply to either of your suggestions. I've had 17 irons in the fire and just now had the time to get back to this. I am downloading the MAMP package as I'm writing this. I'll try that first and post the results.
 
OP
T

The Annoyed Man

Guest
To answer "mynameis"... This does not appear to be a MySQL issue, because phpMyAdmin runs just fine. I can create/edit/delete databases and tables using phpMyAdmin.

What is happening is that, even with the web server running and everything else apparently working, AND with my php documents stored in the home directory, even simple scripts (like echo "howdy") fail to do anything. Nothing happens.
 
OP
T

The Annoyed Man

Guest
tj6106 said:
I had the same problem. Couldn't get it to work at all and ended up installing MAMP (Mac, Apache, Mysql, PHP) to get the whole thing working together. Have you tried to configure your php install with mysql??
My G5 crumped since my original post. I had to completely reinstall the OS to get it running again. I tried your suggestion of installing MAMP, and it seems like a neat solution - if it would work on my machine.

Even with MAMP installed into the applications/ folder, I'm having basically the same issues as before. The MAMP start page will run. phpinfo runs. phpMyAdmin runs. But placing my scripts in htdocs/ is an exercise in futility.

http://localhost:8888/MAMP/htdocs/scriptname.php yields a 404 error.

http://localhost:8888/htdocs/scriptname.php yields a 404 error.

http://localhost:8888/scriptname.php yields a blank page with no html source, even though part of the page is static html.

http://127.0.0.1/scriptname.php yields a refused connection error.

It doesn't seem to matter what I do, I can't display a simple php page.
 
OP
T

The Annoyed Man

Guest
I should add that I've also just purchased an iBook recently with the Tiger edition of OS X on it, and I can't get the MAMP install to work on it either.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top