Escolar Documentos
Profissional Documentos
Cultura Documentos
PLANET
Neil Gee
HOME
MACOS
WEBDEV
ALL POSTS
CONTACT
Subscribe to
the Latest
Posts
Keep Me Posted!
Setting Stuff Up
LATEST
POPULAR
COMMENTS
Get Apache,
MySQL, PHP and
phpMyAdmin
working on macOS Sierra
System
Requirements for
macOS Sierra Is
PHP
MySQL
Sierra
Upgrade to PHP 5.6
phpMyAdmin
or 7 on Mac OSX
10.11 El Capitan and
OSX 10.6 10.10
Permissions
Speeding Up OSX
10.11 El Capitan
Apache/WebSharing
Their is no GUI to toggle Web Sharing on or off in OSX 10.11,
which was previously a GUI option in System Preferences
way back in 10.7, but fear not Apache is installed ready to be
fired up.
This needs to be done in the Terminal which is found
at /Applications/Utilities/Terminal
Tags
apache
backup baseband
Bing
Coolest Guy
on the Planet
boot
custom
database
css
drupal
el
Google image
instadmg ios iphone
mac
PageRank
mysql OSX
php private public
SERPS
lion
shell
SEO
ssh terminal
Twitter unstoppables
Yahoo
to stop it
sudo apachectl stop
to restart it
sudo apachectl restart
It Works!
Document Root
Document root is the location where the files are shared from
the file system and is similar to the traditional names of
public_html and htdocs, OSX has historically had 2 web
roots one at a system level and one at a user level you can
set both up or just run with one, the user level one allows
Sites Folder
If you dont already have one (very likely), then create one
1 root
wheel
LoadModule authz_host_module
libexec/apache2/mod_authz_host.so
Whilst you have this file open also to get php running
uncomment. (Mentioned also in the PHP part of the article).
LoadModule php5_module libexec/apache2/libphp5.so
And uncomment:
Include /private/etc/apache2/users/*.conf
osx-htaccess-override
PHP
Write out and Save using the nano short cut keys at the
bottom control o and control x
Reload apache to kick in
sudo apachectl restart
MySQL
MySQL is again a missing component in OS X 10.11 and
needs to be dowloaded from the MySQL site use the Mac OS
X 10.10 (x86, 64-bit), DMG Archive version (works on
10.11). The latest version available is MySQL 5.7.9. This
version corrects previous issues with starting mysql on boot
as Apple changed the launch process on OSX Yosemite
onwards.
If you are upgrading from a previous OSX and have an older
MySQL version you do not have to update it, it will work just
Run the standard install which will also install a System Pref
Pane and support for launching MySQL on boot.
Something new in the latest version of MySQL for OSX that is
after the install you are give a temporary password which you
need to take a copy of, you can change that later.
Starting MySQL
Relaunch you System Preference and you will see a new
MySQL Preference, which you can start/stop MySQL and
also enable to have it launch on boot.
To stop
sudo launchctl unload -F
/Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist
export PATH="/usr/local/mysql/bin:$PATH"
mysql -v -u root -p
You will get the version number again, just type \q to exit.
phpMyAdmin
First fix the 2002 socket error if you havent done so from the
MySQL sectionsudo mkdir /var/mysql
mkdir ~/Sites/phpmyadmin/config
Switch to the Authentication tab and set the local mysql root
user and the password.
Add in the username root (maybe already populated, add in
the password that you set up earlier for the MySQL root user
set up, click on save and you are returned to the previous
screen.
(This is not the OSX Admin or root password it is the
MySQL root user).
Permissions
To run a website with no permission issues it is best to set the
web root and its contents to be writeable by all, since its a
local development it shouldnt be a security issue.
Lets say that you have a site in the User Sites folder at the
following location ~/Sites/testsite you would set it to be
writeable like so:
sudo chmod -R a+w ~/Sites/testsite
of OSX El Capitan.
Share this:
89
Related