Just how do I set which Apache/ PHP 10.6 should run?

All my troubles originated from attempting to get mcrypt for PHP mounted. Last evening I gave up and also followed a tutorial of just how to do an entirely fresh apache2 and also php5.3.3 install. I did this making use of MacPorts.

Regretfully, that really did not enable mcrypt for me last evening, although I was rather happy that I obtained 5.3.3 running. :)

The trouble is that I have actually awakened today to locate that my php variation is pull back to 5.3.1 which can just suggest that OS X has actually changed to my initial Apache and also PHP.

Just how to I inform OS X to make use of the software program I mounted using MacPorts?

(And afterwards I will certainly as a new inquiry of just how to enable mcrypt)

0
2019-05-04 17:53:45
Source Share
Answers: 3

You have 2 remedies:

  1. You need to modify the international PATH variable to add MacPort folders at the start. It has the order of folders the system makes use of to locate binaries.
  2. Backup initial binaries (in /usr/bin, /bin, ...), after that add symlinks to MacPorts binaries.

Generally, do not make use of alternative 2 till you actually recognize what you're doing. I simply stated it due to the fact that it's practically feasible.

To modify the international PATH variable, modify the documents /etc/paths, add /opt/local/bin at the start and also ultimately reboot to use adjustments.

You can regulate, after the reboot, that adjustments have actually been made by do the adhering to command:

resemble $PATH

You need to see /opt/local/bin prior to /usr/bin:/bin:….

0
2019-05-09 05:07:29
Source

It's not a lot your variation of Apache/PHP have actually been changed - it's simply the incorrect variation is filled.

If you have Mac OS X's Web Sharing allowed it will certainly vehicle enable the variation of Apache and also PHP Apple gives making use of the LaunchDaemon org.apache.httpd.plist in /System/Library/LaunchDaemons (this will certainly bypass MacPorts variation). You'll intend to disable this by either switching off Web Sharing in the Sharing Preference Pane or by running sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist.

When you mounted Apache for MacPorts it mounted a LaunchDaemon right into /Library/LaunchDaemons which if made it possible for will certainly start up the MacPorts variation of Apache instantly. To enable it run sudo launchctl load -w /Library/LaunchDaemons/org.macports.apache2.plist and also you're off to the races.

If you're running apachectl to reactivate - see to it you've picked the appropriate variation. You might require to modify your $PATH to have /opt/local/apache2/bim prior to /usr/sbin

As for what variation of PHP is being made use of ; on the command line this will certainly rely on your $PATH while for Apache it's totally in your arrangement of where the libphp5 component is. (/etc/apache2/ for the constructed in variation, /opt/local/apache2/conf for the variation MacPorts mounted)

0
2019-05-09 04:53:36
Source

Why does OS X require to recognize which Apache to make use of? Simply run the proper Apache on your own. Open Terminal, cd to the MacPorts directory site having the proper Apache (possibly /opt/something/something/something/Apache2/bin or something like that), and also run it (possibly something like ./httpd).

0
2019-05-08 02:25:45
Source