I got stuck while setting up PHP on my Mac. I downloaded it via brew and I have it on my computer.
PHP 8.0.26 (cli) (built: Nov 23 2022 05:33:21) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.26, Copyright (c) Zend Technologies
with Zend OPcache v8.0.26, Copyright (c), by Zend Technologies
this is what i get when I type php --ini in Terminal:
Configuration File (php.ini) Path: /opt/homebrew/etc/php/8.0
Loaded Configuration File: /opt/homebrew/etc/php/8.0/php.ini
Scan for additional .ini files in: /opt/homebrew/etc/php/8.0/conf.d
Additional .ini files parsed: /opt/homebrew/etc/php/8.0/conf.d/ext-opcache.ini
I tried to add /opt/homebrew/etc/php/8.0 into my settings.json but it didn't work out.
I appreciate any help!
I tried to change path of PHP to MAMP's PHP, but it did not apply. Also I have phpinfo.php file that is located in:
/Library/WebServer/Documents/phpinfo.php
Related
Trying to install Xdebug so I can debug PHP with VS Code, followed the instructions of the page step by step, reference Xdebug wizard.
Download php_xdebug-3.1.6-8.1-vs16-x86_64.dll
Move the downloaded file to \xampp\php\ext, and rename it to php_xdebug.dll
Update C:\xampp\php\php.ini and add the line:
zend_extension = xdebug
Restart the Apache Webserver
To verify correct installation run cmd and type php -v, output should list Xdebug installed:
PHP 7.4.10 (cli) (built: Aug 18 2020 09:37:14) ( NTS DEBUG )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.10-dev, Copyright (c), by Zend Technologies
with Xdebug v3.0.0-dev, Copyright (c) 2002-2020, by Derick Rethan
Installation is trivial, I don't have cloned .ini files, I'm getting the right dll from the page, I'm restarting Apache, my renameing of the dll is right. I don't know what is going on, my output from cmd is:
C:\Users\User>php -v
PHP 8.1.13 (cli) (built: Nov 22 2022 15:49:14) (ZTS Visual C++ 2019 x64)
Copyright (c) The PHP Group
Zend Engine v4.1.13, Copyright (c) Zend Technologies
My PHP version is: 8.1.12
Also tried changing the ini file to
;zend_extension="c:\xampp\php\ext\php_xdebug.dll"
which is the actual path where the dll is located. Also my PHP is TS, so is the file it's downloading from the wizard. Any hints?
As #aynber said in a comment, semicolon is used for indicating comments and therefore the line
zend_extension="c:\xampp\php\ext\php_xdebug.dll"
is not processed
I'm a bit confuse on my PHP versions on my local Mac OS X.
When I ran
⚡️ ~ which php
/usr/local/php5/bin/php
⚡️ ~ php --version
PHP 7.3.8 (cli) (built: Aug 11 2019 20:50:16) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.8, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.8, Copyright (c) 1999-2018, by Zend Technologies
with Xdebug v2.7.2, Copyright (c) 2002-2019, by Derick Rethans
⚡️ ~
so this means my CLI version is 5 or 7.3 ?? 😵 !
When I run
php -r "echo ini_get('memory_limit').PHP_EOL;"
I got
256M
the result of that matched with my Apache PHP
See picture below
phpinfo()
I really need to update the meory_limit.
How do I find php.ini of my Apache use?
Updated
I tried to modify /usr/local/php5/lib/php.ini
and set memory_limit = 40096M ~40GB
I never see that settings take place.
Maybe you should just rename /usr/local/php5 to /usr/local/php and the confusion is gone ;)
On your phpinfo() page is a section called "Loaded Configuration File" and "Additional .ini files parsed". These are the files to edit.
I am not sure if there is an upper limit for memory_limit. Maybe just try to set it to -1 to disable it.
Some php installations use different .ini files for running in a cli and running in a browser, to check what .ini files are used on command line use php --ini.
I have to run composer in cpanel terminal to install and host laravel project. But however, it gives this error This package requires php ^7.2.5 but your PHP version (5.6.40) does not satisfy that requirement.
I go Settings >> MultiPHP Manager and select my domain and upgrade PHP version to 7.3
I check my PHP version in ~
[myuser#server ~]$ php -v
PHP 5.6.40 (cli) (built: May 5 2020 19:25:18)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
I go to public_html/www (where my laravel project is placed)
[myuser#server www]$ php -v
PHP 7.3.18 (cli) (built: May 21 2020 03:33:34) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.18, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.18, Copyright (c) 1999-2018, by Zend Technologies
I go to server_information under General Information and the PHP version is 5.6,
so my question is
How to upgrade server PHP version from 5.6 to 7.3
Please note that I don't have root access, and also ApacheEasy4 is also not accessible by my user in Server.
My MultiPHP Manager Image
if in "phpversion" function you see the version of php is 7.x, but in composer is 5.x: it's because your server manager has set default php path in its envirnoment variables to php5 folder. so you need to use "/php/version/php composer" instead of "php composer"
example:
/usr/bin/local/php/7.3/php composer update
for find the path of php binary file, you can use "php --ini" command to see where is "php.ini" location. when you execute this command it tell you the ini configuration file (php.ini) path. actually in the parent of your ini file location is a direction with bin name that its your php binary file location. for example in my server output "php --ini" is:
Configuration File (php.ini) Path: /usr/local/php72/lib
Loaded Configuration File: /usr/local/php72/lib/php.ini
Scan for additional .ini files in: /usr/local/php72/lib/php.conf.d
Additional .ini files parsed: /usr/local/php72/lib/php.conf.d/10-directadmin.ini,
/usr/local/php72/lib/php.conf.d/50-webapps.ini
so is my configuration file (php.ini) path:
/usr/local/php72/lib
and my php binary file is:
/usr/local/php72/bin
and my needed command is:
/usr/local/php72/bin/php composer update
Note: please pay attention don't use "which php". because its show you the global envirnoment value of php path that in your case it has set on php 5.x so you need to call binary file from php 7.x folder. and for do it, you should follow my guide to find your php 7.x binary file path
This command worked for me in CLOUDLINUX 7.9 and cPanel v94.0.4:
/opt/cpanel/ea-php73/root/usr/bin/php /opt/cpanel/composer/bin/composer update
Click on manage on the right and update the server version.
I wondered now with XAMPP (MAC) that why the php.ini file is taking wrong in php cli.
phpinfo(); returning correct version 7.1.
php -v returning like below..
sh-3.2# php -v
PHP 7.0.15 (cli) (built: Jan 22 2017 08:50:55) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
sh-3.2# which php
/usr/local/bin/php
sh-3.2# php --ini
Configuration File (php.ini) Path: /usr/local/etc/php/7.0
Loaded Configuration File: /usr/local/etc/php/7.0/php.ini
Scan for additional .ini files in: /usr/local/etc/php/7.0/conf.d
Additional .ini files parsed: (none)
I want to make the php-cli version as 7.1 to start my development.
How can I do that ?
UPDATE 16.03.2017:
I checked the log and found the following error:
Xdebug requires Zend Engine API version 320151012. The Zend Engine API version 320160303 which is installed, is newer. Contact Derick Rethans at xdebug.org/docs/faq#api for a later version of Xdebug
I understand that I need to compile xdebug using another PHP header but how do I compile this with PHP7? Also, I am already using the latest xdebug version, which is 2.5.1
I installed xdebug on ElementaryOS together with XAMPP (PHP7) and PHPStorm.
When I enter "php -v" in the terminal, I get the following output
PHP 7.0.15-0ubuntu0.16.04.4 (cli) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.15-0ubuntu0.16.04.4, Copyright (c) 1999-2017, by Zend Technologies
with Xdebug v2.4.0, Copyright (c) 2002-2016, by Derick Rethans
In addition, "php --ini" writes:
Configuration File (php.ini) Path: /etc/php/7.0/cli
Loaded Configuration File: /etc/php/7.0/cli/php.ini
Scan for additional .ini files in: /etc/php/7.0/cli/conf.d
Additional .ini files parsed: /etc/php/7.0/cli/conf.d/10-mysqlnd.ini,
/etc/php/7.0/cli/conf.d/10-opcache.ini,
But when running "phpinfo()" in the browser (hosted by XAMPP) the output does not contain "xdebug" and the php installation seems to be another:
Configuration File (php.ini) Path /opt/lampp/etc
Loaded Configuration File /opt/lampp/etc/php.ini
In both php.ini files, I added the following but still no luck:
;[XDebug]
zend_extension="/usr/lib/php/20151012/xdebug.so"
xdebug.remote_enable=On
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=localhost
xdebug.remote_port=9000
I checked that xdebug.so exists at this path. It has the following authorizations:
-rw-r--r-- 1 root root 1225696 Mär 14 2016 /usr/lib/php/20151012/xdebug.so
I have no clue what to try next - maybe someone could give me a hint!
Cheers!