Hot answers tagged

28

It's now possible to install composer running brew install composer Previous answer (for older versions): It seems the solution was running: brew tap homebrew/homebrew-php and then brew install composer After that composer seems to be installed: composer --version Composer version 1.5.5 2017-12-01 14:42:57


16

Removing system macOS binaries is not a good idea, they will be reinstalled during a next system upgrade and they could be needed by some system scripts. To enable the homebrew php from the command line, read the output of brew info php70: If you wish to swap the PHP you use on the command line, you should add the following to ~/.bashrc, ~/.zshrc, ~/....


15

Edit /private/etc/apache2/httpd.conf Find the line that says LoadModule php5_module libexec/apache2/libphp5.so and uncomment it by editing out the # at the beginning of the line. (Then save the file, obviously.) Go to Terminal and type sudo apachectl graceful at the console:


15

/etc/php.ini.default serves only as a reference and is not read out by PHP at all. The built-in PHP installation will look for the file /etc/php.ini instead. This file is not present by default, but you can copy /etc/php.ini.default to /etc/php.ini and make your modifications in there. You could also just create an empty file and only add any directives you ...


14

Instead of guessing which php.ini you need to alter, run this command to locate the file: php -r 'phpinfo();' | grep 'php.ini' Even though I use MAMP PRO, by default my command-line PHP commands are not executed using their copy of PHP. In my case it says the file is found at /etc/php.ini Once you have located the file, follow the instructions on all of ...


14

You are trying to install in /usr which is protected by SIP (System Integrity Protection), a feature introduced with 10.11 (see What is the "rootless" feature in El Capitan, really? for details). Use /usr/local instead, which is the location intended for user-side installations.


10

I had the same problem - it's based on mod_userdir exclusion after updating to Mac OS X Mojave. There are a few steps to repair that: Load the module mod_userdir in /etc/apache2/httpd.conf At the end of the httpd.conf make sure to load httpd-userdir.conf In httpd-userdir.conf include a local file in /etc/apache2/users/<username>.conf Put a directory ...


7

Yes, you can, as long as you install the command line tools. You can then install the command line tools with xcode-select --install For more information (from the iOS Dev Library, but applicable in this case), see Technical Note TN2339


6

Apache is the process that needs to have appropriate permissions to access /var/www. Apache is typically user _www of group _www on MacOS. Verify this with: grep -e '^Group\|^User' /etc/apache2/httpd.conf Two lines should be printed. My output looks like: User _www Group _www This means that on my system, Apache processes run as user _www with group ...


6

The brew commands look ok. You have all the taps you need. First of all since you're working with homebrew, I'd suggest the following two commands (let's start clean): brew update && brew cleanup So we're sure that we're using the latest homebrew release and we cleanup all old formulas and leftovers. From your PATH it looks like usr/bin (which is ...


6

The $ is just an example for the shell prompt in whatever instruction guide you are reading (used to indicate that you should run the command from your standard user account. A # would indicate that you should run the command as an admin/root user). Just run php -v instead.


6

Now as time passed, this works for me: $ brew install composer


5

As has been pointed out already, unless you are specifically forwarding http traffic from your router to your machine, your locally hosted stuff will only be available to you and the other computers on your local network. To answer your question on restricting access to your webserver to just your machine. You can do this a couple of ways. Remember, ...


5

Actually, the #1 advantage to using MAMP is tremendous: Each time you upgrade your system, your environment won't break! There were a couple of Snow Leopard updates (or maybe it was Leopard to Snow Leopard, I can't remember) that broke Mysql. One was by moving the mysql.socket file. There was another update the broke PHP. In both cases I had to hunt around ...


5

The Mojave update (or re-install) overwrites the apache directory but left my old configs with the ~previous suffix left. I did edit a lot of previous files in my apache path /private/etc/apache2. These files were renamed to like httpd.conf~previous and a new httpd.conf has taken place. I just renamed files, restart my apache and everything is working ...


4

There really isn't a good reason to run your web server as root. It opens you up to all kinds of potential abuse. OS X defaults to running the service as a severely under privileged user to protect you. Don't make these changes unless you're absolutely certain you know what you're doing! The httpd.conf file for the default Apache2 installation that comes ...


4

From http://drupal.org/node/66187 (drupal may be irrelevant for your needs, but their site had a good explanaton - wanted to source it for you, and give credit to them) By default, MAMP has the memory limit that a script can use set at 8MB, which is the PHP default. Looking at PHP's php.ini-recommended file, this memory limit is normally set at 128MB. To ...


4

I'm assuming that the deployment/install script was put at /usr/local/packager/packager.py when it was installed. Apparently, you can use this script to list the packages that are installed: /usr/local/packager/packager.py list Unfortunately, the script that you used to install PHP doesn't appear to have an uninstall feature. However, you should be able to ...


4

It seems as you did not add the new path to your $PATH. Citing the FAQ of the website that you have posted: Why does php -v on the command line still show my old version? php-osx doesn't overwrite the php binaries installed by Apple, but installs everyting in /usr/local/php5. The new php binary is therefore in /usr/local/php5/bin/php. You can ...


4

On OS X you'll have following : The base PATH used is located in /etc/paths. It is used to set $PATH. By default, the file contains : /usr/bin /bin /usr/sbin /sbin /usr/local/bin It will also load the paths located in /etc/path.d/. When opening the terminal I will load : ~/.bash_profile ~/.bash_login, (if .bash_profile doesn't exist) ~/.profile (...


4

Since upgrade to Yosemite updated your Apache, you have to update phpMyAdmin.conf to use new Access control syntax. Have a look at: http://httpd.apache.org/docs/2.4/upgrading.html In my case I need changed /etc/apache2/other/phpMyAdmin.conf Order allow,deny Allow from all to Require all granted More info here: http://www.zoubi.me/blog/you-dont-have-...


4

Export your PATH with some like this (check your php version): export PATH=/usr/local/Cellar/php71/7.1.14_25/bin:$PATH


4

Here an (old) 3rd party PHP probably from entropy.ch was installed to /local/usr/bin/. The Sierra httpd.conf was modified to work with the different PHP (and virtual hosts). While updating to macOS to High Sierra, the Sierra httpd.conf was backed up to httpd.conf.sierra, a new High Sierra httpd.conf was installed and gained control, but won't work with the ...


4

As the documentation suggests, you need to locate and edit the file: /opt/lampp/etc/extra/httpd-xampp.conf The hard part for me was locating this file. The solution I found was to ensure the stack volume was mounted: From there, you can click the explore button, which will open /opt/lampp/. You can then navigate to etc/extra/httpd-xampp.conf from the ...


3

Don't uninstall the old php as it is /usr/bin and so supplied by Apple and so might affect the OS and Apple might reinstall it as part od an OS upgrade. The binary install of php puts php in /usr/local/bin/php To use it either use the full path or alter your PATH environment variable to have /usr/local/bin before /usr/bin


3

Probably you added one or more bin directories (containing mysql and php) to your $PATH. Remove them. The three php* files in /usr/bin belong to the default OS X system and are completely legit.


3

In my opinion, the right way is to set your path to prefer your installation of PHP. Apple restricts PHP so you can't delete it without bypassing the system integrity protection Apple will update those files any time it pleases, so you're always needing to re-do whatever steps you take to modify the system If you make a virtual environment like docker or ...


3

Your Mac's built in webserver is turned on. To Turn On: sudo apachectl start To Turn Off: sudo apachectl stop The process you are actually looking for is httpd, the Apache server. $ ps -ef | grep httpd 0 76078 1 0 3:56am ?? 0:00.32 /usr/sbin/httpd -D FOREGROUND 70 76084 76078 0 3:56am ?? 0:00.00 /usr/sbin/httpd -D ...


3

I faced a similar issue on Mojave update, I was able to fix it by updating /etc/hosts file with ::1 localhost YouMacName.local 127.0.0.1 localhost YouMacName.local You can get YourMacName.local by running in terminal: $ hostname I hope it helps you


Only top voted, non community-wiki answers of a minimum length are eligible