[HOWTO] - Setup PHP & MySQL

Status
Not open for further replies.
mrhappy,

i beleive the paths and the set-up procedures are different depending on whether you use the source or the package installations. if you use the entropy pacakage install...the one in uoba's link, the directory path should be:

/usr/local/mysql/scripts/mysql_install_db

have you verified the contents of each directory along the way to ensure the files are where you expect them to be?
 
this howto is not for the source version. The source version should be avoided by anyone who fears the visiting the command line unhelped. I do not reccomend the source version just yet. I will be updating the how to to accomodate one as soon as I get it to compile correctly.

~Yoshi
 
I just guessed:

[localhost:/] co% phpinfo
phpinfo: Command not found.

...obviously wrong!;)

Can you enlighten me?
 
put it in text file, and save the file as test.php then put it in a web accesible lcation and call it through the browser
 
uoba,

how are you coming on the php? have you been able to test it yet?

btw, it looks as if the april security update made some changes to the .conf file. so if you are still having troubles, that might be part of the problem.
 
Well, I loaded up the php script yoshi supplied, and it seemed to work okay -- reporting a few errors, but seemingly working.

Unfortunately I think I've been playing around so much that I have come to the conclusion that I need a clean install of OSX on one of the machines, and use it specifically for testing this sort of thing.

Fortunately, my girlfriend/business partner is taking maternity leave (my fault!), so there is now an unused G4 400 sitting there... I wonder if she'll mind!:p
 
First off - I am on an 800MHz G4 iMac. I've got Apache working, installed a new PHP module, and even installed MySQL.

(Thanks Marc - http://www.entropy.ch/software/macosx/)

So my question is, can I only use this when I am connected to the Internet. My first reaction would be yes, of course. You are sitting on a webserver, why couldn't you use it. I have a dial-up connection, and whenever I want to see any of my site files -- they only will pull up when I am connected. I usually put in 127.0.0.1/~drew/test.php (or whatever other folder I want to access) and it works great. The above file shows the data for my php installation, I can get into phpmyadmin and browse/edit/create databases for MySQL. I've even installed a module (thanks again Marc) that starts MySQL on start-up automatically for me. This is perfect for when I'm developing and testing my websites at home. My httpd.conf file is up-to-date with the php extensions and everything.

Then came the bad news. I disconnected from the internet (damn I need a cable modem... anyway...). And went back to IE to play in phpmyadmin and MySQL again. it told me that the pages or site couldn't be found. I thought 127.0.0.1 was a local address? I've tried using localhost/~drew... nothing.
Again - my whole set-up works perfectly, but only when I'm connected to the Internet. NOT when I am sitting "locally" at my machine.

How - please tell me - can I use my machine with PHP, and MySQL without being on the internet? Or can't I? Do I have to be on some way or another?

What (if anything) did I do wrong - or didn't yet do??


thanks for any help from you guys(and girls) out there..
** first time poster **
- drewb2b:confused:
 
Not that anyone has read this yet - being it's at the end of the list, but I think I've found an answer to anyone else that is having this problem. I just asked my boss, (who is a big time Mac OS X user) and he told me the problem is with my machine thinking that it's not on a network.

Bascially, He said I should put in some fake address numbers for the Ethernet port (like the ones on my machine at work here) so that my machine "thinks" it's on a network. That way, I should be able to access 127.0.0.1 or localhost via the browser. Since my PPP connection basically says 'This machine is a dead paper-weight until you hit connect...' I can see how this would work. I have't tried it yet, but will be checking it out when I get home tonight.

If any of you have any reason why this wouldn't work - do you have any other suggestions?

thanks
drewb2b
 
That seems to make sense, since the Network System Pref always seems to go hand-in-hand with Modem and Ethernet connections. I guess you really only need to assign your computer an IP address from the Ethernet prefs. Just to let your machine know it has one.

Anyone else?
 
I have ran through this and I can't seem to find anyone with the knowledge to fix it. The post in response said come to IRC. I keep getting

Access denied for user: '@localhost'

Anyone have any clue as too why this happens???

Thjanks,
Spencer Parker
 
Yoshi,

I still cannot get php to run on my G4. I got it running on my iMac without any problems.

On the tower I'm still getting the apache module started, but when I place any php files in the Sites folder, I still get the "not found" page.
 
OK,

Now php does not work on either machine. I came to work this morning and php would not work on my iMac. The only new thing on the iMac is that I upgraded to 10.1.4. But I checked php out right after the install, and it still worked. Now it does not. My G4 tower was running 10.1.4 before I put php on it, and it has not worked yet.

Is there an incompatibility between php4.2 and OS X 10.1.4?
 
Yoshi:

I tried the URL for the MySql files at machowto.com but the files aren't there. There isn't even a mailto button to find out if perhaps they are just moving things around or perhaps the server is down? Any clues?

Thanks,
Earl
 
I am totally new to either UNIX and MySQLm and have some doubts about what exactly I did when following these instructions to install MySQL.

Can someone please explain what the following line tells the system to do?

Code:
sudo ./bin/safe_mysqld --user=mysql &

Also, why there is a need to create a MySQL user in the Users system preferences? I thought system users and mysql users were not the same thing and that mysql dealt with its own user authentication, l/p, privileges to read/write databases and all that stuff despite what user was logged into Mac OS X.
 
Status
Not open for further replies.
Back
Top