When I try to use the database through php (launching the console php -a), using sentences to connect such as mysql_connect(DB_HOST, DB_USUARIO, DB_PASSWORD) it will return the error This will allow you to access through the console and do things such asīut now, there is an additional challenge. Sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /tmp/mysql.sock I could not access the mysql database from console, getting this errorĮRROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ Thanks to evilReiko for this ServerFault solution Sudo nano /Users/YOURNAME/sites//index.htmlĪnd very importantly, restart the MAMP (click on Stop and then Start). In DocumentRoot you may use the destination folder you wishĪdditionally you have to add the domain to etc/hosts, you may do this:įinally, add some content inside the destination folder, Sudo nano /Applications/MAMP/conf/apache/nfĪt the bottom of the file, add the following NameVirtualHost *ĭocumentRoot "/Users/YOURNAME/sites/" As an example, we will use Then you need to do this:Įdit /Applications/MAMP/conf/apache/nf in your favourite text editor or with command line: Note that this destination folder can be changed easily via GUI:īut let’s suppose you would like to host different webs locally. You will notice than when you start up the app, you will see the content on This content is hosted in folder: We are going to focus on the plain MAMP app, which is the one you can use with no cost. Well, it is possible, you just need to configure a couple of files and you are done!įirst of all, let’s remark that when you download MAMP and install it on Mac, it will create two separate apps within the Applications Folder: You would like to host several domains locally with MAMP in Mac OSX and you are wondering if this can be done with the free version, right?
0 Comments
Leave a Reply. |