[HOWTO] - Setup PHP & MySQL

Status
Not open for further replies.
ok..I have no idea what your talking about. I copied and pasted every last thing you said to make sure i didnt type it wrong. When I copied ans psated sudo apxs -e -a -n php4 libexec/httpd/libphp4.so this stuff below came up on its own.

[activating module `php4' in /private/etc/httpd/httpd.conf]
cp /private/etc/httpd/httpd.conf /private/etc/httpd/httpd.conf.bak
cp /private/etc/httpd/httpd.conf.new /private/etc/httpd/httpd.conf
rm /private/etc/httpd/httpd.conf.new

it gave me another prompt and I copied and pasted
sudo perl -p -i.bak -e 's%#(AddType \S+-php[ -])%$1%i' httpd.conf
so I dont see where i went wrong.
and with the mysql..yea I forgot to install it..my bad...but when I do..where do I install it to? Can you give me a command on that?

I am very very very new to this. I been looking for tutorials on this stuff...but I found yours and it seemed easy enough. lol I followed step by step..and still somehow mess up. :)
 
Okay after half an hour on your computer via SSH I have got Apache + php working :).

After step 7 a unique step for you is required since the apache server was complaining about not being able to find libphp.so which is and should be named libphp4.so I just simply typed this:
sudo mv /usr/libexec/httpd/libphp4.so /usr/libexec/httpd/libphp.so

to fix the problem. After that you could go to step 8 normally. I reccomend anyone else having the same php + apache problem to try that. Now everything should be working. I will do mysql if you wish as well..

Cheers

~Yoshi
 
This is what I am getting when trying to do mysql
Welcome to Darwin!
[localhost:~] nate% cd /usr/local/mysql
[localhost:/usr/local/mysql] nate% sudo ./scripts/mysql_install_db
Preparing db table
Preparing host table
Preparing user table
Preparing func table
Preparing tables_priv table
Preparing columns_priv table
Installing all prepared tables
Installation of grant tables failed!

Examine the logs in ./data for more information.
You can also try to start the mysqld daemon with:
./bin/mysqld --skip-grant &
You can use the command line tool
./bin/mysql to connect to the mysql
database and look at the grant tables:

shell> ./bin/mysql -u root mysql
mysql> show tables

Try 'mysqld --help' if you have problems with paths. Using --log
gives you a log in ./data that may be helpful.

The latest information about MySQL is available on the web at
http://www.mysql.com
Please consult the MySQL manual section: 'Problems running mysql_install_db',
and the manual section that describes problems on your OS.
Another information source is the MySQL email archive.
Please check all of the above before mailing us!
And if you do mail us, you MUST use the ./bin/mysqlbug script!
[localhost:/usr/local/mysql] nate%
 
I followed your instructions and as soon as I enter the "sudo apachectl graceful" command I get the following response in Terminal:

/usr/sbin/apachectl graceful: httpd not running, trying to start
Syntax error on line 240 of /etc/httpd/httpd.conf:
API module structure `php4_module' in file /usr/libexec/httpd/libphp4.so is garbled - perhaps this is not an Apache module DSO?
/usr/sbin/apachectl graceful: httpd could not be started

I've downloaded the module and installed it a few times. Any suggestions?

metropol
 
I ran into a little trouble. I had trouble starting MySQL. I thought it maybe something I screwed up while poking around. So I downloaded it again, installed and took the steps. I also installed the automatic start. However I went to "/usr/local" and found two different versions. I downloaded the newer one, 3.23.49. I tried to delete the 3.23.47 but it would not let me. This is the reply"rmdir: mysql-3.23.47: Directory not empty" I'm new to the command line. What should I do?
 
I got these installations to work without a hitch and "mysql test" worked fine that first time. However, I have restarted my computer and now I get this error message when I try to test or use mysql in any way:
ERROR 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

I don't have a clue what might of happened. :( Any help would be appreciated.

Thanks!
 
Okay buddy, here is whats up, MySQL by default doesn't startup at startup time so after you restart your MacOSX machine you need to enter a few command in the terminal to startup MySQL. The steps you need to follow are under this paragraph. Do them every time your restart!

Step 1) Start Terminal and type cd /usr/local/mysql

Step 2) type "sudo ./bin/safe_mysqld --user=mysql &

Step 3) Enter your Password

and thats it, you can close the terminal and mysql should be started.

Hope this helps :)
*Note*
The link for the package no longer works and I am putting up a mirror on my own server for you guys to download it at okay.
*/NOTE*
 
I cannot seem to download the MySQL package. I get this:


Not Found
The requested URL /download/mysql-3.23.47.pkg.tar.gz was not found on this server.


Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
------------------------------------------------------------------------
Apache/1.3.22 Server at www.www2.entropy.ch Port 80

:(
 
Thanks for the great help on mysql. It works fantastically!

Now, php is not working. I have done all of the steps exactly, and it appears that apache is configured (at least partially) because I get this in the error_log when I do a graceful restart:

[Mon Mar 11 11:31:10 2002] [notice] Apache/1.3.22 (Darwin) PHP/4.1.2 configured -- resuming normal operations

I am trying to test it with a document called test.php containing:

<?php phpinfo() ?>

help!

- dm
 
Use this script

################
#Php Information Page #
################
<?php
phpinfo();
?>


~Yoshi
 
I had the same problem a lisamac, and this solved the problem for me..
I just ran steps 6 and 7 again after I rebooted, and I could access my databases.

Type "cd /usr/local/mysql"
type "sudo chown -R mysql /usr/local/mysql/*"
type "sudo ./bin/safe_mysqld --user=mysql &"

then type "mysql test"

to use the database test in mysql.

I just hope I don't have to run this every time I reboot, anyone know how to have it automaticaly initiate at startup?

-Eric
 
i've been able to install mysql and query the sever. however, i seem to be unable to shut it down or make any password changes. i get the "access denied for user: '@localhost'.

i've checked the manual included with the distribution and the web and am stuck. when i tried to set a password for the root account using
"mysqladmin password" it told me i was "using mysql as an anonymous users and anonymous users are not allowed to change passwords"

any help would be greatly appreciated.

thanks!
 
Status
Not open for further replies.
Back
Top