Solved

Difference between PHPINFO and WHICH PHP on Mac

Posted on 2011-09-03
1
2,031 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 500 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
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 create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

689 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