简体   繁体   English

狮子上的多个PHP版本,如何删除一个

[英]Multiple Version of PHP on lion, how to remove one

I'm trying to set up a PHP development environment on my Mac (lion) and I'm having a hard time installing pear , phpunit, and xdebug because I think I have multiple versions of PHP running on my computer. 我正在尝试在Mac(狮子)上建立一个PHP开发环境,而我在安装pear,phpunit和xdebug方面遇到了困难,因为我认为我的计算机上运行着多个PHP版本。

When I'm in the command line and I type php -i 当我在命令行中输入php -i时

I get Xdebug installed: 2.1.2 我安装了Xdebug:2.1.2
Server API: Command Line Interface 服务器API:命令行界面
Windows: no Windows:否
Zend Server: no Zend服务器:否
PHP Version: 5.3.8 PHP版本:5.3.8
Zend API nr: 220090626 Zend API编号:220090626
PHP API nr: 20090626 PHP API编号:20090626
Debug Build: no 调试版本:否
Thread Safe Build: no 线程安全构建:否
Configuration File Path: /etc 配置文件路径:/ etc
Configuration File: /private/etc/php.ini 配置文件:/private/etc/php.ini
Extensions directory: /usr/lib/php/extensions/no-debug-non-zts-20090626 扩展目录:/ usr / lib / php / extensions / no-debug-non-zts-20090626

But when I enable Web Sharing in preferences, create a file with 但是,当我在首选项中启用Web共享时,请使用
then navigate to that in my browser like: localhost/phpinfo.php 然后在我的浏览器中导航到该主机,例如:localhost / phpinfo.php

I get these settings: 我得到以下设置:

Xdebug installed: no 已安装Xdebug:否
Server API: Apache 2.0 Handler 服务器API:Apache 2.0处理程序
Windows: no Windows:否
Zend Server: no Zend服务器:否
PHP Version: 5.4.0 PHP版本:5.4.0
Zend API nr: 220100525 Zend API编号:220100525
PHP API nr: 20100525 PHP API编号:20100525
Debug Build: no 调试版本:否
Thread Safe Build: no 线程安全构建:否
Configuration File Path: /usr/local/php5/lib 配置文件路径:/ usr / local / php5 / lib
Configuration File: /usr/local/php5/lib/php.ini 配置文件:/usr/local/php5/lib/php.ini
Extensions directory: 扩展目录:

As you can see, I have two different configuration files... What is going on here? 如您所见,我有两个不同的配置文件...这是怎么回事? I need to be able to install phpunit and this is giving me lots of trouble! 我需要能够安装phpunit,这给我带来了很多麻烦!

That's normal. 那很正常 PHP keeps two copies of the .ini files, because command-line operation is significantly different from web-based usage. PHP保留.ini文件的两个副本,因为命令行操作与基于Web的用法有很大不同。 Things like max execution time, memory limits, various web-specific config options, etc... are disabled/maxed-out when running in CLI mode. 在CLI模式下运行时,诸如最大执行时间,内存限制,各种特定于Web的配置选项等...将被禁用/最大化。

I would be concerned about the two different PHP versions, however. 但是,我将关注两个不同的PHP版本。 You've got 5.3.8 for command line and 5.4.0 for web-based. 您在命令行中有5.3.8,在基于Web的中有5.4.0。 That means you've got two completely independent installs of PHP. 这意味着您已经安装了两个完全独立的PHP。 The cli version would seem to be a one-off, since it's looking /private, and not the usual /usr/local directories for config/ini info. cli版本似乎是一次性的,因为它看起来是/ private,而不是通常的/ usr / local目录中的config / ini信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM