Jump to content

Recommended Posts

Hi guys, got a bit of an issue.  I have a WAMP server set up on my windows XP computer and I need to set up a similar environment on the MAC 10.6.4.  Last time i tried configuring the built in Apache on the MAC and installing php and mysql it got really messy.  The localhost page went all black as well as the php.ini file!

 

So could anyone recommend the easiest method of configuring/installing php/mysql/server on the MAC.  Is there something like WAMP out there?  I don't mind recreating the tables from the Windows XP install as long as it installs smoothly.

 

I would like to run the server locally.

Thanks

 

 

Link to comment
https://forums.phpfreaks.com/topic/214470-install-on-mac-1064/
Share on other sites

Thanks, I just installed MAMP, the server is up and running and I have created sql tables etc.  But I can't seem to connect to the database.

 

The code is :

 

$con=mysql_connect('localhost','root','root');mysql_select_db('project1',$con);

 

 

I haven't changed the user or the password and i get the 'Access denied for user root at local host using password yes' error!

 

I get nothing in the mysql or apache logs but in php log I get this:

 

PHP Warning:mysql_select_db() expects parameter 2 to be resource, boolean given...

 

 

And the above code is line 1 and 2.  Any help would be very appreciated, thanks.

Link to comment
https://forums.phpfreaks.com/topic/214470-install-on-mac-1064/#findComment-1116301
Share on other sites

It's killing me that I can't remember what the problem was. Have you tried to return any connection errors?

 

<?php
$link = mysql_connect('localhost', 'root', 'root');
if (!$link) {
    die('Could not connect: ' . mysql_error());
}

Link to comment
https://forums.phpfreaks.com/topic/214470-install-on-mac-1064/#findComment-1116374
Share on other sites

I just noticed something strange, when i add a new user and gave full privileges and tried the same script with different user and corresponding password I got the same Access denied for root user.  So i edited one of my script files in terms of content, stopped MAMP and started it and the change was not reflected!  I restarted the Mac and still the same thing.

Link to comment
https://forums.phpfreaks.com/topic/214470-install-on-mac-1064/#findComment-1116401
Share on other sites

Ah I've found the solution though it was rather stupid of me but misleading from MAMP I would say.  I had put the path for the start page of MAMP as /frontpage.php.  Assuming it meant /htdocs/frontpage.php .  So I copied all my files directly into htdocs but i also had a subfolder in htdocs which the Apache Document root was set to. 

 

All the time I was thinking that because the start up page was directly in htdocs it would refer to the rest of the pages there and not the subfolder.

 

Thanks Pikachu for your effort, really appreciated.

Link to comment
https://forums.phpfreaks.com/topic/214470-install-on-mac-1064/#findComment-1116409
Share on other sites

It may be a day late on this, but it's just sooo much better to use a virtual machine.  Sun virtualbox works great on the Mac.  Then you can have your lamp setup without having to install all these services into your workstation.  Last but not least, when you deploy onto a lamp server, you know that things will probably work fine because you developed under the exact same platform you'll deploy to.

Link to comment
https://forums.phpfreaks.com/topic/214470-install-on-mac-1064/#findComment-1116411
Share on other sites

Sun virtualbox is something I always forget about, since it isn't available for PowerPC machines. I tried VirtualPC, but it sucked the life out of my brain, and since Mac abandoned the RISC architecture, there hasn't been much development in that arena, that I'm aware of.

Link to comment
https://forums.phpfreaks.com/topic/214470-install-on-mac-1064/#findComment-1116419
Share on other sites

Sun virtualbox is something I always forget about, since it isn't available for PowerPC machines. I tried VirtualPC, but it sucked the life out of my brain, and since Mac abandoned the RISC architecture, there hasn't been much development in that arena, that I'm aware of.

 

 

Wow Dude, you are still using a PPC based mac!  We need to take up a collection to get you upgraded  ;) 

 

But you do make a good point that netbooks and older comps will have an issue with virtualization.  Virtualbox runs really well on any intel based machine, although you do need to have enough ram that you can aportion some off to the vm.

Link to comment
https://forums.phpfreaks.com/topic/214470-install-on-mac-1064/#findComment-1116421
Share on other sites

I happen to like my PPC Mac. It runs more than fast enough for me. The only thing that drags it down is the video card when I run my X-Plane flight sim. But yeah, someday I'll upgrade . . . Probably to a quad PPC. Gotta wait til that x86 architecture is proven, ya know! :)

Link to comment
https://forums.phpfreaks.com/topic/214470-install-on-mac-1064/#findComment-1116423
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.