Download Phpmyadmin for Mac Os X Yosemite
Get your Local Web Evolution Environs Up & Running on macOS Big Sur 11 and Catalina 10.15
With Apples' new macOS Big Sur 11 available for download, hither is how to become the AMP stack up and running on the new macOS. This tutorial will go through the process of getting Apache, MySQL, PHP (or otherwise known equally the 'AMP' stack) and phpMyAdmin running on the new mac OS Big Sur.
This guide will as well work on macOS Catalina and Mojave.
This tutorial sets upwardly the AMP stack in more of a traditional mode using the loaded Apache and PHP and downloading MySQL and phpMyAdmin.
Apache/WebSharing
Web serving is congenital into Big Sur with Apache app, it is installed ready to be fired upwardly.
This needs to be washed in the Terminal which is found in the Os filing arrangement at /Applications/Utilities/Concluding
For those not familiar with the Last, it really isn't as intimidating as you may think, one time launched y'all are faced with a command prompt waiting for your commands - merely type/paste in a command and hit enter, some commands give you no response - information technology simply means the command is done, other commands give you feedback.
Using the prefix of sudo is required for commands that accept their applications protected in specific folders - when using sudo you will need to confirm with your admin password or iCloud password if set up upwardly that way.... let's become to it ...
to start Apache web sharing
sudo apachectl get-go
to stop it
sudo apachectl end
to restart it
sudo apachectl restart
To observe the Apache version
httpd -v
The Apache version that comes in macOS Large Sur is Apache/two.4.46
After starting Apache - test to see if the webserver is working in the browser - http://localhost - y'all should see the "It Works!" text.
If you don't become the localhost test, you tin endeavour troubleshooting Apache to see if there is anything wrong in its config file by running
apachectl configtest
This volition requite you an indication of what might be wrong.
Document Root
Certificate 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', macOS has historically had 2 web roots 1 at a arrangement level and ane at a user level - you tin set both up or just run with one, the user level one allows multiple accounts to have their own web root whilst the system i is global for all users. It seems there is less endeavour from Apple in continuing with the user level ane but it still tin be gear up with a couple of extra tweaks in configuration files. It is easier to use the user level one as you don't have to continue on authenticating as an admin user.
Organisation Level Web Root
- the default system document root is still found at -
http://localhost/
The files are shared in the filing arrangement at -
/Library/WebServer/Documents/
User Level Root
The other web root directory which is missing by default is the '~/Sites' folder in the User account. This takes a bit longer to set up upwardly simply some users are very accustomed to using it.
You need to brand a "Sites" binder at the root level of your account and then it will work. Once you make the Sites folder yous will notice that it has a unique icon which is a throwback from a few versions older. Make that binder earlier you set upwardly the user configuration file described side by side.
You have to make a few boosted tweaks to get the ~/Sites binder support and running.
Add a "username.conf" filed under:
/etc/apache2/users/
If you don't already take one (very probable), then create one named by the short username of the business relationship with the suffix .conf, its location and permissions/ownership is all-time tackled by using the Terminal, the text editor 'nano' would exist the best tool to deal with this.
If you would rather edit config files in a text editor as an app I would advise text editor similar the free BBEdit which allows you to open hidden system files.
Launch Terminal, (Applications/Utilities), and follow the commands below, first one gets you to the right spot, second one opens the text editor on the command line (swap 'username' with your business relationship's shortname, if you don't know your business relationship shortname type 'whoami' the Final prompt):
cd /etc/apache2/users
sudo nano username.conf
And so add the content below swapping in your 'username' in the code below, in that location is a slightly unlike user directive for Large Sur and Catalina, make sure 'Crave host localhost' is used:
<Directory "/Users/username/Sites/"> AllowOverride All Options Indexes MultiViews FollowSymLinks Require host localhost </Directory>
Permissions on the file should be:
-rw-r--r-- 1 root wheel 298 Jun 28 16:47 username.conf
If not, yous need to change information technology...
sudo chmod 644 username.conf
Open up the master httpd.conf and allow some modules:
sudo nano /etc/apache2/httpd.conf
And make sure these modules are uncommented (the first 2 should already be on a clean install):
LoadModule authz_core_module libexec/apache2/mod_authz_core.so
LoadModule authz_host_module libexec/apache2/mod_authz_host.then
LoadModule userdir_module libexec/apache2/mod_userdir.so
LoadModule include_module libexec/apache2/mod_include.then
LoadModule rewrite_module libexec/apache2/mod_rewrite.so
While y'all have this file open up likewise to become php running, uncomment the below ... (Mentioned too in the PHP part of the article).
LoadModule php7_module libexec/apache2/libphp7.and so
And besides uncomment this configuration file also in httpd.conf - which allows user home directories.
Include /private/etc/apache2/extra/httpd-userdir.conf
Salve all your changes (Control + O in nano)
Then open another Apache config file and uncomment some other file:
sudo nano /etc/apache2/extra/httpd-userdir.conf
And uncomment:
Include /private/etc/apache2/users/*.conf
Save all your changes (Control + O in nano)
Restart Apache for the new file to be read:
sudo apachectl restart
Then this user level document root will be viewable at:
http://localhost/~username/
You should but see a directory tree like structure if the folder is empty.
Override .htaccess and allow URL Rewrites
If you are going to use the spider web serving document root at /Library/WebServer/Documents it is a skillful idea to allow whatever .htaccess files used to override the default settings - this can be achieved by editing the httpd.conf file at line 217 and setting the AllowOverride to All and and then restart Apache. This is already taken intendance of at the Sites level webroot by following the previous pace.
sudo nano /etc/apache2/httpd.conf
Besides while here let URL rewrites so your permalinks look clean, non ugly.
Uncomment in httpd.conf - should be uncommented on a clean install.
LoadModule rewrite_module libexec/apache2/mod_rewrite.then
PHP
PHP seven.3.24 is loaded in this version of macOS Large Sur and needs to be turned on by uncommenting a line in the httpd.conf file.
sudo nano /etc/apache2/httpd.conf
Use "control" + "w" to search inside nano and search for 'php' this will land you on the right line then uncomment the line (remove the #):
LoadModule php7_module libexec/apache2/libphp7.and so
Write out and Save using the nano shortcut keys at the bottom 'control o' and 'control x'
Reload Apache to kick in
sudo apachectl restart
To run across and test PHP, create a file name it "phpinfo.php" and file it in your document root with the contents below, then view it in a browser.
<?php phpinfo(); ?>
Here you will see that Apple are non intending on bundling PHP in the macOS in the time to come, maybe with the adjacent incarnation of the OS, but for now it's working albeit not version 7.4. However you tin can apply a Homebrew PHP solution that allows for any PHP version to be used.
[email protected] Documents % php -v WARNING: PHP is not recommended PHP is included in macOS for compatibility with legacy software. Hereafter versions of macOS will non include PHP. PHP 7.3.24-(to be removed in future macOS) (cli) (congenital: Dec 21 2020 21:33:25) ( NTS ) Copyright (c) 1997-2018 The PHP Grouping Zend Engine v3.3.24, Copyright (c) 1998-2018 Zend Technologies
MySQL
MySQL doesn't come pre-loaded with macOS Large Sur and needs to exist dowloaded from the MySQL site.
The latest version of MySQL 8.0.23 does work with the latest release of macOS.
Use the macOS x.15 (x86, 64-bit), DMG Archive version (works on macOS Big Sur).
If you lot are upgrading from a previous macOS and have an older MySQL version you lot do not have to update it.
Likewise if you have a clean install and want the earlier MySQL version 5.seven, you can still become this from the MySQL site - from the 'Looking for previous GA versions' link. (MySQL 8 is relatively new and not in many production set up ups)
1 thing with MySQL upgrades, always have a information dump of your database in instance things go s and earlier you lot upgrade to macOS Catalina make sure your MySQL Server is non running.
When downloading you don't have to sign up, expect for » No thanks, merely start mydownload - get straight to the download.
One time downloaded open the .dmg and run the installer.
During the MySQL process y'all are prompted to choose between potent and legacy password encryptions, since version eight is entirely new, some software similar phpMyAdmin tin can't connect with the newer encryptions - so if you are going to utilise a GUI wrapper like phpMyadmin I advise you stick to legacy.
Then add a password for the MySQL root user.
Add Mysql to your path
Afterward installation, in order to use MySQL commands without typing the full path to the commands yous demand to add the mysql directory to your shell path, (optional step) this is done in your Zsh shell profile ".zshrc" file in your home directory (previous shells were bash ), if you don't take that file just create it using vi or nano:
cd ; nano .zshrc
consign PATH="/usr/local/mysql/bin:$PATH"
The first command brings you to your abode directory and opens the .zsh file or creates a new one if it doesn't exist, then add together in the line above which adds the MySQL binary path to commands that you lot tin can run. Go out the file with blazon "control + x" and when prompted to save the change past typing "y". The concluding thing to exercise here is to reload the shell for the above to work straight abroad.
source ~/.zshrc
Modify the MySQL root password
(This section is left in for reference - in previous macOS MySQL packages the password prepare during the installation process would fail - hence the info below. This newer version, withal, seems to piece of work).
Note that this is not the same as the root or admin countersign of macOS - this is a unique countersign for the MySQL root user.
Stop MySQL
sudo /usr/local/mysql/support-files/mysql.server stop
Start it in safe mode:
sudo mysqld_safe --skip-grant-tables
This will be an ongoing command until the process is finished and so open some other crush/final window, and log in without a password as root:
mysql -u root
FLUSH PRIVILEGES;
Alter USER 'root'@'localhost' IDENTIFIED By 'MyNewPass';
Change the lowercase 'MyNewPass' to what yous desire - and keep the unmarried quotes.
\q
Start MySQL
sudo /usr/local/mysql/support-files/mysql.server beginning
Starting MySQL
You lot can then start the MySQL server from the Arrangement Preferences adds to the concluding row or via the command line.
The new MySQL organisation preference too has the uninstall feature - useful if you've installed it with a security encryption that's not working for yous and want to try the other one. You lot can also see the paths to the config and data sources of MySQL in the configuration tab.
Or to Control line start MySQL.
sudo /usr/local/mysql/support-files/mysql.server commencement
To find the MySQL version from the final, blazon at the prompt:
/usr/local/mysql/bin/mysql -5 -uroot -p
This also puts you into a vanquish interactive dialogue with MySQL, type \q to leave.
Fix the 2002 MySQL Socket mistake
Ready the looming 2002 socket mistake - which is linking where MySQL places the socket and where macOS thinks information technology should be, MySQL puts it in /tmp and macOS looks for it in /var/mysql the socket is a type of file that allows MySQL customer/server communication.
sudo mkdir /var/mysql
sudo ln -due south /tmp/mysql.sock /var/mysql/mysql.sock
phpMyAdmin
Showtime fix the 2002 socket fault if you haven't washed so from the MySQL section-
sudo mkdir /var/mysql
sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock
Download phpMyAdmin, the zip English language package volition adapt a lot of users, then unzip it and move the folder with its contents into the certificate root level renaming binder to 'phpmyadmin'.
Make the config binder
mkdir ~/Sites/phpmyadmin/config
Change the permissions
chmod o+westward ~/Sites/phpmyadmin/config
Run the prepare in the browser
http://localhost/~username/phpmyadmin/setup/ or http://localhost/phpmyadmin/setup/
You need to create a new localhost mysql server connection, click new server.
Switch to the Authentication tab and gear up the local MySQL root user and the password.
Add in the username "root" (perhaps already populated, add in the password that you fix earlier for the MySQL root user set up, click on save and you lot are returned to the previous screen.
(This is not the macOS Admin or root countersign - it is the MySQL root user)
At present going to http://localhost/~username/phpmyadmin/ will now allow you to interact with your MySQL databases.
Permissions
To run a website with no permission issues it is best to set the web root and its contents to be writeable past all since it'due south a local evolution it shouldn't exist a security issue.
Let's say that you have a site in the User Sites binder at the post-obit location ~/Sites/testsite you would set it to be writeable like so:
sudo chmod -R a+west ~/Sites/testsite
If you are concerned nearly security so instead of making information technology earth writeable yous can set up the possessor to exist Apache _www just when working on files you would have to authenticate more every bit admin you lot are "not" the owner, y'all would do this like so:
sudo chown -R _www ~/Sites/testsite
This will set the contents recursively to be owned by the Apache user.
If yous had the website stored at the Organization level Document root at say /Library/WebServer/Documents/testsite and then information technology would have to be the latter:
sudo chown -R _www /Library/WebServer/Documents/testsite
Some other more straightforward way to do this if you have a ane user workstation is to change the Apache web user from _www to your account.
That'south it! You at present have the native AMP stack running on top of macOS Big Sur or Catalina.
To ready vritual hosts aka vhosts on Apache bank check the guide here.
If you are a WordPress user and want a shine lean local development environs - too worth checking out is Laravel Valet which runs on summit of macOS - check out my Valet WordPress Guide on macOS.
Download Phpmyadmin for Mac Os X Yosemite
Posted by: clarencepeenionved.blogspot.com

0 Komentar
Post a Comment