New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus • Advice and insight from world-class Apple enthusiasts • Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
Web Design and Hosting Creating sites, scripting, and hosting discussions.

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


Post Reply New Thread Subscribe

 
Thread Tools
The Annoyed Man
Guest
 
Posts: n/a

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.
QUOTE Thanks
tj6106
Guest
 
Posts: n/a

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??
QUOTE Thanks
mynameis

 
Member Since: Sep 30, 2004
Posts: 3,378
mynameis is just really nicemynameis is just really nicemynameis is just really nicemynameis is just really nice

mynameis is offline
Probably a problem with the authentication protocol: http://dev.mysql.com/doc/mysql/en/old-client.html

Do you get any error messages when you try mysql_connect()?
QUOTE Thanks
The Annoyed Man
Guest
 
Posts: n/a

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.
QUOTE Thanks
The Annoyed Man
Guest
 
Posts: n/a

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.
QUOTE Thanks
The Annoyed Man
Guest
 
Posts: n/a

Quote:
Originally Posted by tj6106
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.
QUOTE Thanks
The Annoyed Man
Guest
 
Posts: n/a

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.
QUOTE Thanks

Post Reply New Thread Subscribe


« Does OSX Apache contain the standard modules? | I need to design a very simple website! »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Connecting to Mac from PC problem beetlejelly OS X - Operating System 11 08-23-2012 09:47 AM
Window users that are MAC WANNA BE'S! jdoverkill Switcher Hangout 47 10-12-2006 02:48 PM
It's called a Mac iSheep Schweb's Lounge 22 10-13-2004 05:35 PM

All times are GMT -4. The time now is 05:58 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?