-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathosxampsetup.rtf
65 lines (48 loc) · 1.83 KB
/
osxampsetup.rtf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
OSX 10.9 Mavericks local php server setup
to start it
sudo apachectl start
to stop it
sudo apachectl stop
to restart it
sudo apachectl restart
To find the Apache version
httpd -v
After starting Apache – test to see if the webserver is working in the browser – http://localhost – you should see the “It Works!” text.
Check that you have a “username.conf” filed under:
/etc/apache2/users/
If you don’t (very likely), then create one named by the short username of the account with the suffix .conf, it’s location and permissions/ownership is best tackled by using the Terminal, the text editor ‘nano’ would be the best tool to deal with this.
cd /etc/apache2/users
sudo nano username.conf
Then add the content below swapping in your ‘username’ in the code below:
<Directory "/Users/username/Sites/">
Options Indexes MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
Permissions on the file should be:
-rw-r--r-- 1 root wheel 298 Jun 28 16:47 username.conf
If not you need to change…
sudo chmod 644 username.conf
Restart Apache for the new file to be read:
sudo apachectl restart
Override .htaccess
/etc/apache2/httpd.conf
AllowOverride all
PHP
edit /etc/apache2/httpd.conf
Use “control” + “w” to search within nano and search for ‘php’ this will land you on the right line then uncomment the line (remove the #):
LoadModule php5_module libexec/apache2/libphp5.so
Reload apache to kick in
sudo apachectl restart
test a php file
MYSQL
download and install mysql and some mysql client
http://dev.mysql.com/downloads/mysql/
or run: bash <(curl -Ls http://git.io/eUx7rg)
in ~/.bash_profile
export PATH="/usr/local/mysql/bin:$PATH"
/usr/local/mysql/bin/mysqladmin -u root password 'yourpasswordhere'
fix socket error
sudo mkdir /var/mysql
sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock