简体   繁体   English

Mac LAMP上的梨设置

[英]Pear setup on Mac LAMP

Got a LAMP setup (as per Remy Sharp's set up) on OSX Snow Leopard, PHP 5.3 在OSX Snow Leopard,PHP 5.3上进行了LAMP设置(根据Remy Sharp的设置)

A site I am trying to run locally is built in CodeIgniter and utilises PEAR which until now I have not used locally. 我尝试在本地运行的站点是在CodeIgniter中构建的,并且使用了PEAR,直到现在我还没有在本地使用过。

I downloaded it but it seems that my local environment doe snot know where to look for PEAR. 我下载了它,但似乎我的本地环境确实不知道在哪里可以找到PEAR。

  • which pear: /usr/bin/pear 哪个梨:/ usr / bin / pear
  • which php: /usr/bin/php 哪个php:/ usr / bin / php

my php.ini file has: include_path=".:/usr/bin/pear 我的php.ini文件具有:include_path =“。:// usr / bin / pear

But for some reason I am just getting an error: Message: require_once(Date.php): 但是由于某种原因,我只是收到一个错误:消息:require_once(Date.php):

even though Date.php has been installed in Pear 即使Date.php已安装在Pear中

Any thoughts? 有什么想法吗?

Ha! 哈! I've played this game across the years on Tiger, Panther, Leopard... 我多年来一直在Tiger,Panther,Leopard上玩过这款游戏。

It's a lesson in frustration if you choose to go down this path--whatever you fix could be trashed the next time Apple wants to rename the /etc/httpd direcotry /etc/apache2. 如果您选择走这条路,那将是一个令人沮丧的教训–下次Apple要重命名/ etc / httpd目录/ etc / apache2时,无论您修复的内容如何,​​都将被浪费掉。 Then I just gave up. 然后我就放弃了。 My advice is to not use the built in Mac Lamp stack, but to turn off Web sharing in the System Preferences and download and install MAMP or Zend server. 我的建议是不要使用内置的Mac Lamp堆栈,而是要在“系统偏好设置”中关闭Web共享并下载并安装MAMP或Zend服务器。

MAMP is configured with everything inside the MAMP.app package, mysql, php (with most pear/pecl libs you need), and apache. MAMP配置了MAMP.app软件包,mysql,php(需要使用大多数pear / pecl库)和apache中的所有内容。 It also comes with a util to start/stop your servers. 它还带有一个用于启动/停止服务器的实用程序。

Now.... 现在....

If you must go down the route of not using something like MAMP/Zend Server, I'm assuming somewhere your include path is being overwritten. 如果您必须遵循不使用MAMP / Zend Server之类的方法,那么我假设您的包含路径已被覆盖。

Somewhere before the error, but after the framework is loaded, try this: 在错误发生之前的某个地方,但是在加载框架之后,请尝试以下操作:

echo get_include_path();

See if you're path still is what you set in the INI file. 看看您的路径是否仍然是您在INI文件中设置的路径。 If not, mischief is going on. 如果没有,那就是恶作剧。 Usual places to check: 通常检查的地方:

  • .htaccess file in docroot of site 网站docroot中的.htaccess文件
  • config files for your framework--they love to overwrite logging and path ini settings! 框架的配置文件-他们喜欢覆盖日志记录和路径ini设置!
  • Somewhere in your code someone is calling set_include_path('/some/path') or ini_set('include_path', '/some/path') 在您的代码中某处有人在调用set_include_path('/ some / path')或ini_set('include_path','/ some / path')

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

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