Created
January 7, 2022 14:20
-
-
Save ahmadshuami/e120b6e635aeb92dd73fcd3d79392368 to your computer and use it in GitHub Desktop.
How to Setup Apache, PHP 8.0, MariaDB and Apache Virtual Host using Homebrew Part 2 - Installation of PHP 8.0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Watch the video at https://youtu.be/3ESdXYOloeQ | |
1. Add new tap for php | |
% brew tap shivammathur/php | |
2. Install php | |
% brew install shivammathur/php/php@8.0 | |
3. Link the php | |
% brew link --overwrite --force php@8.0 | |
4. Close terminal | |
5. Check installed php | |
% php -v | |
6. Tell apache to use php. Open apache config file | |
% subl /usr/local/etc/httpd/httpd.conf | |
7. Add the following lib module | |
LoadModule php_module /usr/local/opt/php@8.0/lib/httpd/modules/libphp.so | |
8. Set directory indexes for php. Add index.php in this setting | |
<IfModule dir_module> | |
DirectoryIndex index.php index.html | |
</IfModule> | |
9. Add this lines | |
<FilesMatch \.php$> | |
SetHandler application/x-httpd-php | |
</FilesMatch> | |
10. Restart apache | |
% brew services restart httpd | |
11. Validate php | |
Create info.php file | |
12. Test | |
http://localhost/info.php |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment