Jump to content

PhpInfo And Php -V Show Different Versions


FlyAbove

Recommended Posts

I am using a mac and when I type php -v I get the version php 8.1.12 but when I load the phpinfo page from xampp it shows 8.1.5 and I am wondering how I can get the phpinfo page to show the same thing as php -v (it also give me the xdebug extension which does not show up in phpinfo)? I have 2 different php ini files. One for xampp and the other for php8.1.

Link to comment
Share on other sites

You could, you know, not install two different copies of PHP...

XAMPP is a bundle with its own software. That's kinda the point of having it in the first place. Way I figure it, you either keep that bundle and run its PHP (first step: uninstalling the other one) or you keep the system one and switch Apache to run PHP scripts through it instead.

I think I'll suggest keeping XAMPP because then you don't have to deal with server configuration. I don't know OSX particularly well but I'm sure you can somehow create a "php" alias pointing to the binary that came with XAMPP. Though you'll probably still have to deal with different CLI and web configurations, but at least that's mostly just copying or symlinking php.ini files.

Link to comment
Share on other sites

On 11/12/2022 at 9:43 PM, FlyAbove said:

I am thinking of downloading the latest version of xampp but if I did would it show xdebug in phpinfo?

Personally, I would recommend uninstalling xamp and using docker.  There are a lot of projects out there that offer a docker-compose that orchestrates a lamp environment for you.  Devilbox is a massively complete project that offers a myriad of different configurations (not just lamp), but there are many others, not to mention lots of tutorials showing how you can create your own.  I even made a project myself to support some of the work I do.  I have seen a good deal of discussion of people who primarily make Laravel apps using Laravel Sail, but it can be used for any php project afaik.

With that said, if you absolutely must have something similar to what xampp provides, people seem to like Laragon.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.