Osx-macminibrew has php54 installed, but is my job php 5.3.15?

Source: Internet
Author: User
I have copied the php. ini file and php file to the etc folder and bin folder. Enter & quot; php-v & quot; below the command line to display PHP5.4.19. However, I used info. php to check whether PHPVersion5.3.15 was used. What is the problem? Where can I modify it? According to the floor... I have copied php. the INI file and php file are under the/etc/folder and bin folder. Enter "PHP-v" under the command line to display php 5.4.19. However, I used info. php to check whether PHP Version 5.3.15 was used. What is the problem? Where can I modify it?

According to the instructions of my predecessors downstairs, I also deleted files such as php and re-linked them, but I don't know why I used info. php check, it is still PHP Version 5.3.15. Where can I modify the default php path to the new php path? Where did I not notice it? Thank you for your patience!

I am using the OS x server program. Does this program have its own php path?

It has been preliminarily determined that the OS x server does not call the system's apache and php at all. It should use the Integrated Environment in its own package and do not know how to modify it. OS X SERVER is really not easy to use. There is nothing to set.

The problem has been disabled. cause:

Reply content:

I have copied the php. ini file and php file to the/etc/folder and the bin folder. Enter "PHP-v" under the command line to display php 5.4.19. However, I used info. php to check whether PHP Version 5.3.15 was used. What is the problem? Where can I modify it?

According to the instructions of my predecessors downstairs, I also deleted files such as php and re-linked them, but I don't know why I used info. php check, it is still PHP Version 5.3.15. Where can I modify the default php path to the new php path? Where did I not notice it? Thank you for your patience!

I am using the OS x server program. Does this program have its own php path?

It has been preliminarily determined that the OS x server does not call the system's apache and php at all. It should use the Integrated Environment in its own package and do not know how to modify it. OS X SERVER is really not easy to use. There is nothing to set.

PHP installed through homebrew is located in

/Usr/local/Cellar/php54/5.4.19/# the paths of different version numbers may vary. Correct the paths by yourself.

Homebrew automatically adds a soft connection. If you can directly specify the PHP Command path during normal work, you can directly use this connection.

# Location/usr/local/opt/php54/bin/php # connections of different versions/usr/local/bin/php # connections under the default PATH directory # For example/usr/local /opt/php54/bin/php-f test. php
Mac OS itself comes with PHP. If you run a PHP Command without a PATH, the system uses the default PATH to find the command, that is, the following:
/Usr/bin/php/usr/bin/phpize/usr/bin/php-config/usr/bin/php-cgi... # pecl, pear, peardev, phar, and phar. several phar commands are not very common. adjust them as needed.

To replace the default PHP, you can adjust the directory sequence in the default PATH. For more information, see @ zhaoyi.

Default apache module

If you are using the apache module loading method, modify the apache configuration file httpd. conf that comes with Mac, provided that php Is Not Installed--enable-fpm(This option implies -- without-apache). Otherwise, the corresponding libphp5.so file will not be generated:

/Etc/apache2/httpd. conf # modify LoadModule php5_module/usr/local/Cellar/php54/5.4.19/libexec/apache2/libphp5.so

Thanks to @ zhaoyi, we recommend that you modify the directory order in the PATH to change the default execution file./usr/binThe following file side effect is much smaller. The following is not recommended: direct modification/usr/binThe following execution files

# Back up the default version, if you do not want to back up, directly Delete the line mv/usr/bin/php/usr/bin/php-5.3.15... # connect the new version to the bin path ln-s/usr/local/Cellar/php54/5.4.19/bin/php/usr/bin/php... # To keep the source code of PHP-related software consistent by default, you can. /configure input-I parameter mv/usr/include/php/usr/include/php-5.3.15ln-s/usr/local/Cellar/php54/5.4.19/include/php // usr /include/php

You don't have to worry about it. You only need to adjust the path order,

ls -al /usr/local/bin/php/usr/local/bin/php -> ../Cellar/php54/5.4.19/bin/php

Adjust/usr/local/bin to the first place.

cat ~/.bash_profile export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

Reference resources: https://github.com/josegonzalez/homebrew-php

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.