use PhpStorm port安装php80 in mac OSX

本文详细记录了在Mac系统中从PHP7.1.33升级到PHP8.0的过程,包括使用Port安装、配置php.ini、卸载和重新安装PHP,以及安装php80-cgi以适应PHPStorm。在安装完成后,还解决了PHPStorm找不到php-cgi的问题。
摘要由CSDN通过智能技术生成

1. 系统环境的php版本为

PHP 7.1.33 (cli) (built: Jan 26 2020 22:52:32) ( NTS )

Copyright (c) 1997-2018 The PHP Group

Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies

2. 现安装php8.0

megumikichikus-MacBook-Pro:~ xxxx$ sudo port install php

Password:

--->  Computing dependencies for php

The following dependencies will be installed:

argon2

gsed

mhash

pcre2

php80

php_select

Continue? [Y/n]: y

……….

--->  Updating database of binaries

--->  Scanning binaries for linking errors

--->  No broken files found.                             

--->  No broken ports found.

--->  Some of the ports you installed have notes:

  php80 has the following notes:

    To customize php80, copy /opt/local/etc/php80/php.ini-development (if this is a development server) or /opt/local/etc/php80/php.ini-production (if this is a production server)

    to /opt/local/etc/php80/php.ini and then make changes.

3. —————————设置php.ini——————————

megumikichikus-MacBook-Pro:~ xxxx$ cd /opt/local/etc/php80

megumikichikus-MacBook-Pro:php80 xxxx$ sudo cp php.ini-production php.ini

设置系统原版本7.1.33的配置文件,

megumikichikus-MacBook-Pro:~ xxxx$ sudo cp /etc/php.ini.default /etc/php.ini

4. 演示卸载清除port安装的php,

megumikichikus-MacBook-Pro:~ xxxx$ sudo port uninstall --follow-dependencies php

--->  Deactivating php @8.0_0

--->  Cleaning php

--->  Uninstalling php @8.0_0

The following dependencies will be uninstalled:

php80 @8.0.12_0+libedit

argon2 @20190702_1

gsed @4.8_0

mhash @0.9.9.9_1

pcre2 @10.37_0

php_select @1.0_0

pkgconfig @0.29.2_0

再安装,

megumikichikus-MacBook-Pro:~ xxxx$ sudo port install php

--->  Computing dependencies for php

The following dependencies will be installed:

argon2

gsed

mhash

pcre2

php80

php_select

pkgconfig

Continue? [Y/n]: --->  Fetching archive for argon2

--->  Attempting to fetch argon2-20190702_1.darwin_18.x86_64.tbz2 from http://mse.uk.packages.macports.org/argon2

--->  Attempting to fetch argon2-20190702_1.darwin_18.x86_64.tbz2.rmd160 from http://mse.uk.packages.macports.org/argon2

--->  Installing argon2 @20190702_1

--->  Activating argon2 @20190702_1

--->  Cleaning argon2

--->  Fetching archive for gsed

--->  Attempting to fetch gsed-4.8_0.darwin_18.x86_64.tbz2 from http://mse.uk.packages.macports.org/gsed

--->  Attempting to fetch gsed-4.8_0.darwin_18.x86_64.tbz2.rmd160 from http://mse.uk.packages.macports.org/gsed

--->  Installing gsed @4.8_0

--->  Activating gsed @4.8_0

--->  Cleaning gsed

--->  Fetching archive for mhash

--->  Attempting to fetch mhash-0.9.9.9_1.darwin_18.x86_64.tbz2 from http://mse.uk.packages.macports.org/mhash

--->  Attempting to fetch mhash-0.9.9.9_1.darwin_18.x86_64.tbz2.rmd160 from http://mse.uk.packages.macports.org/mhash

--->  Installing mhash @0.9.9.9_1

--->  Activating mhash @0.9.9.9_1

--->  Cleaning mhash

--->  Fetching archive for pcre2

--->  Attempting to fetch pcre2-10.37_0.darwin_18.x86_64.tbz2 from http://mse.uk.packages.macports.org/pcre2

--->  Attempting to fetch pcre2-10.37_0.darwin_18.x86_64.tbz2.rmd160 from http://mse.uk.packages.macports.org/pcre2

--->  Installing pcre2 @10.37_0

--->  Activating pcre2 @10.37_0

--->  Cleaning pcre2

--->  Fetching archive for php_select

--->  Attempting to fetch php_select-1.0_0.darwin_18.noarch.tbz2 from http://mse.uk.packages.macports.org/php_select

--->  Attempting to fetch php_select-1.0_0.darwin_18.noarch.tbz2.rmd160 from http://mse.uk.packages.macports.org/php_select

--->  Installing php_select @1.0_0

--->  Activating php_select @1.0_0

--->  Cleaning php_select

--->  Fetching archive for pkgconfig

--->  Attempting to fetch pkgconfig-0.29.2_0.darwin_18.x86_64.tbz2 from http://mse.uk.packages.macports.org/pkgconfig

--->  Attempting to fetch pkgconfig-0.29.2_0.darwin_18.x86_64.tbz2.rmd160 from http://mse.uk.packages.macports.org/pkgconfig

--->  Installing pkgconfig @0.29.2_0

--->  Activating pkgconfig @0.29.2_0

--->  Cleaning pkgconfig

--->  Fetching archive for php80

--->  Attempting to fetch php80-8.0.12_0+libedit.darwin_18.x86_64.tbz2 from http://mse.uk.packages.macports.org/php80

--->  Attempting to fetch php80-8.0.12_0+libedit.darwin_18.x86_64.tbz2.rmd160 from http://mse.uk.packages.macports.org/php80

--->  Installing php80 @8.0.12_0+libedit

--->  Activating php80 @8.0.12_0+libedit

--->  Cleaning php80

--->  Fetching archive for php

--->  Attempting to fetch php-8.0_0.darwin_18.noarch.tbz2 from http://mse.uk.packages.macports.org/php

--->  Attempting to fetch php-8.0_0.darwin_18.noarch.tbz2.rmd160 from http://mse.uk.packages.macports.org/php

--->  Installing php @8.0_0

--->  Activating php @8.0_0

--->  Cleaning php

--->  Some of the ports you installed have notes:

  php80 has the following notes:

    To customize php80, copy /opt/local/etc/php80/php.ini-development (if this is a development server) or /opt/local/etc/php80/php.ini-production (if this is a production server)

    to /opt/local/etc/php80/php.ini and then make changes.

5. 安装 php80-cgi 

megumikichikus-MacBook-Pro:~ xxxx$ sudo port install php80-cgi

--->  Computing dependencies for php80-cgi

--->  Fetching archive for php80-cgi

--->  Attempting to fetch php80-cgi-8.0.12_0.darwin_18.x86_64.tbz2 from http://mse.uk.packages.macports.org/php80-cgi

--->  Attempting to fetch php80-cgi-8.0.12_0.darwin_18.x86_64.tbz2.rmd160 from http://mse.uk.packages.macports.org/php80-cgi

--->  Installing php80-cgi @8.0.12_0

--->  Activating php80-cgi @8.0.12_0

--->  Cleaning php80-cgi

--->  Updating database of binaries

--->  Scanning binaries for linking errors

--->  No broken files found.                             

--->  No broken ports found.

--->  Some of the ports you installed have notes:

  php80-cgi has the following notes:

    If this is your first install, you need to enable php80-cgi in your web server.

安装完成后,在 /opt/local/bin/目录下,多了php-cgi80

phpstorm ——> Please ensure that configured PHP Interpreter built as CGI program (--enable-fastcgi was specified)

phpstorm找不到cgi,所以执行

megumikichikus-MacBook-Pro:php80 xxxx$ cd /opt/local/bin/

megumikichikus-MacBook-Pro:bin xxxx$ sudo cp php-cgi80 php-cgi

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值