?
Solved

Difference between PHPINFO and WHICH PHP on Mac

Posted on 2011-09-03
1
Medium Priority
?
2,037 Views
Last Modified: 2013-12-13
Hi,

I have just installed MAMP on my Mac, without an issue.

However, I have an issue where the PHP.ini file being used by Apache (installed via MAMP) appears to be different from the PHP.ini file being used by the CLI.

Here are the details...

I am trying to install the ViMP CMS system on the machine, which requires the SourceGuardian extension to be installed.

The SG extension was installed with no problem, and details of the extension are showing up in phpinfo().

As part of the setup process, Vimp requires a command to be entered in the CLI, which executes a php file, which is encrypted using SourceGuardian.

However, when I attempt to run this php file, it crashs on the 2nd line, reporting that it cannot find the SourceGuardian library.

I investigated further, and checked the PHP.ini file that was being used.

Reported by Apache via phpinfo(): /Applications/MAMP/bin/php/php5.3.6/conf
Reported by CLI via "which php": /usr/bin/php

This at least seems to explain why it can't find the SG library, as it is not specified in the /usr/bin/php version of the php.ini file.

I understand that PHP comes preinstalled, but not activated, with the Mac. It has not been activated.

Can anyone give any advice??
0
Comment
Question by:trumes
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 2000 total points
ID: 36478647
Your understanding is correct and many installations use separate 'php.ini' files because things that are available thru the web server cause errors in the command line.  However, I think your setup is even more complicated because I don't think you're seeing the same versions of PHP.  You can run 'phpinfo' at the command line to see what version it is reporting and where it thinks it's files are.  If it doesn't run then you might go to the directory where the MAMP PHP is located and try running it there.

Because OS X comes with PHP, MAMP doesn't use the 'standard' directories for it's versions and you are probably having to use a different port too.  Here's an article about using the MAMP version for CLI: http://stackoverflow.com/questions/954910/how-to-run-a-php-script-from-the-command-line-with-mamp
<?php phpinfo() ?>

Open in new window

0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question