If you only have one web server on your server configured, then the file you want to modify is /etc/httpd/sites/0000_any_80_.conf. Each virtual server has a configuration file in that directory so it is in those files that you must enable AllowOverride All. In that directory are the virtual host configuration files. The correct file to add the AllowOverride All directive is in the directory /etc/httpd/sites/. Note: for Mac OS X Server 10.4 (Tiger Server) and most likely previous versions as well, do not make changes to /etc/httpd/nf expecting the AllowOverride All directive to work. You can create a file /private/etc/httpd/users/nf for all your Drupal-specific changes (even if you have no user named Drupal) and they will be loaded when Apache starts up. System updates will leave these files untouched. So any changes you want to make should be made in one or more configuration files of your own construction. Any file in the directory /private/etc/httpd/users/ ending with “.conf” will effectively be appended to /etc/httpd/nf. To make changes to the Apache configuration you should NOT edit /etc/httpd/nf but instead edit files in /private/etc/httpd/users/. Now comes the more involved part- changing the webserver configuration. Turn on "personal web sharing" in the sharing panel of System Preferences to start Apache. The stock version of Apache that comes with your Mac should be fine. PHP is also available from Marc Liyanage. You can get Mac binaries for OS X 10.3 and 10.4 from MySQL. But, obviously some of those requirement scan be problematic if they involve your host machine (and PHP always will).Install and configure MySQL and PHP. One of the biggest advantages of a containerized approach to local development is that you truly can change requirements between projects. The TLDR is that even doing the this trick, it’s best to pick a version of PHP and stick with it for that project. However, the you aren’t necessarily out of hot water here because a lot of php dependencies are locked into particular versions of PHP and just because your composer says “it’s ok to run PHP 8” doesn’t mean you can have dependencies for both… so you’ll essentially have to choose one version of PHP and you may still have problems. The advantage of this is that host machines like mine (running PHP 8) wouldn’t throw the same sort of errors. The final tip I’ll call out is that you can define multiple PHP versions in your composer.json. I will flag that this method doesn’t work well with Drupal VM because you cannot install Drupal VM via composer in the first place if your composer.json file requires a version of PHP that you don’t have on your host machine! Defining Multiple PHP Versions Those commands would be something like… composer install If I run it inside of the Lando container, it will be fine because of PHP 7.4. If I run my composer command on the host machine, it will fail because of PHP 8. For instance, I can be running PHP 8 on my host machine with a Lando container running PHP 7.4. There is another option to work around this, which I do sometimes take advantage of and that’s relying on the PHP version inside of my containers. $ brew link Linking /usr/local/Cellar/php/8.0.11. $ brew unlink Unlinking 25 symlinks removed. When you’re done with the PHP 7.x project? Run the commands again in reverse to swap back to PHP 8.x (or whatever). In that case, you might need to also run a command like… $ brew install then you can run the brew link command. The one caveat you might run into is if you don’t have a particular version of PHP installed via Homebrew. You don’t have to restart your terminal, you don’t have to restart your webserver, it just works and it just works immediately. So in my circumstances, I did this: $ brew unlink /usr/local/Cellar/php/8.0.11. To change PHP versions with Homebrew, here’s what you do: Changing around PHP versions in Mac OS is a pain in the butt (and I’ve done it in the past without Homebrew and 0/10 recommend). Part of the reason to use a dependency manager is exactly for circumstances like this. If you do, then this is literally two commands to resolve the problem ( maybe three). If you’ve heard me talk about Devops, or you’ve followed along with my recommended host machine setup procedure, then you should have Homebrew on your machine.
0 Comments
Leave a Reply. |