XAMPP + CakePHP + MySQL Problems

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

XAMPP + CakePHP + MySQL Problems

Postby fdesensi » 09. February 2009 00:20

I am running Mac OS X 10.5.6 and I have installed XAMPP 0.7.4 for os x and I was able to get to the XAMPP control panel however I had to use for the address instead of localhost. I checked /private/etc/hosts and it seems that localhost should be going to

Anyway, my big problem is this....

I need to configure a site for CakePHP development. So I created a directory in /Applications/xampp/xamppfiles/htdocs/ and copied the required CakePHP files into this directory. Then I wanted to add a virtual host so I uncommented the line "# Virtual hosts
Include /Applications/xampp/etc/extra/httpd-vhosts.conf" in httpd.conf and then added the following vhost configuration to httpd-vhosts.conf so that it now looks like this...

Code: Select all
# Virtual Hosts
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
# You may use the command line option '-S' to verify your virtual host
# configuration.

# Use name-based virtual hosting.
NameVirtualHost *:80

# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
<virtualhost *:80>
  DocumentRoot /Applications/xampp/xamppfiles/htdocs/test_app/app/webroot
   ServerName test_app
   <Directory "/Applications/xampp/xamppfiles/htdocs/test_app">
      Options Indexes FollowSymLinks
      AllowOverride All

The problem is this...now that I have restarted everything in /Applications/xampp/xamppfiles/htdocs/ is now considered part of the CakePHP application. So if I got to I get an error from CakePHP saying that there is no xampp controller.

One thing that I think might be a problem is that many of the guides for installing cakephp tell you to make changes to /etc/hosts so that there is an setting for test_app. This file normally lives in /private/etc/ in os x 10.5.6 but I don't know what to change since I am using XAMPP.

Oh and I am having one more problem...in the XAMPP control page I can see that MySQL is deactivated. I used the gui program to start it and it says it is starting it and then doesn't say anything else. I tryed to manually start it using mampp start and it says it started and no errors are displayed. I tried to open phpMyAdmin and it says "#2002 - The server is not responding (or the local MySQL server's socket is not correctly configured)"

Does anyone have any suggestions?


Posts: 1
Joined: 08. February 2009 23:10

Re: XAMPP + CakePHP + MySQL Problems

Postby vanheu » 17. February 2011 05:11


It might be useful for people out there using cakephp and Xampp.

The way I made cakephp work for multiple website:
Code: Select all
Listen 80
Listen 81
#NameVirtualHost *:80
<VirtualHost *:81>
    DocumentRoot /opt/lampp/htdocs/test/app/webroot
    ServerName www.blogue.com
    <Directory "/opt/lampp/htdocs/test>
        Options Indexes FollowSymLinks ExecCGI Includes
        AllowOverride All

Bassically, I added the directive LISTEN 81 so apache will listen on the port 81 of localhost. I commented the directive NAMEVIRTUALHOST *:80. I can now get on my cakephp website via localhost:81 and on xampp website via locahost.

Hope this help!
Posts: 1
Joined: 17. February 2011 05:04

Return to XAMPP for Mac OS X

Who is online

Users browsing this forum: No registered users and 5 guests