itachi77 Posted September 26, 2010 Share Posted September 26, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/214470-install-on-mac-1064/ Share on other sites More sharing options...
Pikachu2000 Posted September 26, 2010 Share Posted September 26, 2010 There's MAMP. Quote Link to comment https://forums.phpfreaks.com/topic/214470-install-on-mac-1064/#findComment-1116035 Share on other sites More sharing options...
itachi77 Posted September 27, 2010 Author Share Posted September 27, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/214470-install-on-mac-1064/#findComment-1116301 Share on other sites More sharing options...
Pikachu2000 Posted September 27, 2010 Share Posted September 27, 2010 Have you been able to use phpMyAdmin with it? Quote Link to comment https://forums.phpfreaks.com/topic/214470-install-on-mac-1064/#findComment-1116313 Share on other sites More sharing options...
itachi77 Posted September 27, 2010 Author Share Posted September 27, 2010 I can access the database through the mac terminal with the same password, I can use phpMyAdmin Quote Link to comment https://forums.phpfreaks.com/topic/214470-install-on-mac-1064/#findComment-1116326 Share on other sites More sharing options...
Pikachu2000 Posted September 27, 2010 Share Posted September 27, 2010 Did you verify the user 'root' has the proper privileges on the database, and is allowed to access it from localhost? Quote Link to comment https://forums.phpfreaks.com/topic/214470-install-on-mac-1064/#findComment-1116332 Share on other sites More sharing options...
itachi77 Posted September 27, 2010 Author Share Posted September 27, 2010 yes it says all under privileges for root Quote Link to comment https://forums.phpfreaks.com/topic/214470-install-on-mac-1064/#findComment-1116341 Share on other sites More sharing options...
Pikachu2000 Posted September 27, 2010 Share Posted September 27, 2010 I know I had this same issue when I first installed MAMP, but it's been a long time ago. I'm racking my brain to remember what the solutin was . . . Quote Link to comment https://forums.phpfreaks.com/topic/214470-install-on-mac-1064/#findComment-1116346 Share on other sites More sharing options...
Pikachu2000 Posted September 27, 2010 Share Posted September 27, 2010 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()); } Quote Link to comment https://forums.phpfreaks.com/topic/214470-install-on-mac-1064/#findComment-1116374 Share on other sites More sharing options...
itachi77 Posted September 27, 2010 Author Share Posted September 27, 2010 Nope, it's not returning any connection errors. This is beginning to drive me mad. The only error statements are the Access denied and in the php log file the resource expected boolean given error. Quote Link to comment https://forums.phpfreaks.com/topic/214470-install-on-mac-1064/#findComment-1116387 Share on other sites More sharing options...
itachi77 Posted September 27, 2010 Author Share Posted September 27, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/214470-install-on-mac-1064/#findComment-1116401 Share on other sites More sharing options...
itachi77 Posted September 27, 2010 Author Share Posted September 27, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/214470-install-on-mac-1064/#findComment-1116409 Share on other sites More sharing options...
gizmola Posted September 27, 2010 Share Posted September 27, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/214470-install-on-mac-1064/#findComment-1116411 Share on other sites More sharing options...
Pikachu2000 Posted September 27, 2010 Share Posted September 27, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/214470-install-on-mac-1064/#findComment-1116419 Share on other sites More sharing options...
gizmola Posted September 27, 2010 Share Posted September 27, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/214470-install-on-mac-1064/#findComment-1116421 Share on other sites More sharing options...
Pikachu2000 Posted September 27, 2010 Share Posted September 27, 2010 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! Quote Link to comment https://forums.phpfreaks.com/topic/214470-install-on-mac-1064/#findComment-1116423 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.