[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Difference between PHPINFO and WHICH PHP on Mac

Posted on 2011-09-03
1
Medium Priority
?
2,052 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 84

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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying 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

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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 …
Suggested Courses

649 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