I know there's multiple post about this, but I tried almost everything i found out ..
My problem is that I'm trying to add mongo.so to my MAMP server. It compiles perfectly with the phpize of MAMP and php-config of MAMP. But when I'm trying to put it in the php.ini, it doesn't load it ..
php --version :
PHP 5.5.14 (cli) (built: Jul 25 2014 17:02:08)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
phpize -v :
Configuring for:
PHP Api Version: 20100412
Zend Module Api No: 20100525
Zend Extension Api No: 220100525
php --ini :
Configuration File (php.ini) Path: /Applications/MAMP/bin/php/php5.5.14/conf
Loaded Configuration File: /Applications/MAMP/bin/php/php5.5.14/conf/php.ini
Scan for additional .ini files in: (none)
Additional .ini files parsed: (none)
I tried changing that php.ini, restart and nothing ..
I tried changing the php.ini in /Applications/MAMP/conf/php5.5.14/, restart and nothing ..
What else is needed to adjust to fix it?
EDIT:
I just found out that the PHP API on my phpinfo() page is set to 20121113. What I don't understand is why that doesn't take the same version on my phpize related to the php server ...
Finally, I fixed it myself. For everybody passing by, please note that this was my PHP sources that was not in the good version. So the extension was not configuring with the right version.
Related
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 am trying to configure Xdebug on a local LAMP server with PHP 5.6 and Ubuntu 16.04 installed and am running into some difficulties. After first following the common installation directions: running "sudo apt install php-xdebug", modifying my php.ini to have the correct config, then restarting my apache server, I was not seeing Xdebug in my info.php (only the xdebug.ini that was being parsed in). When I run "sudo apt install php-xdebug" again however it would say that it was installed / up to date.
After trying a couple different things I was looking and saw that the new version of Xdebug no longer supports version lower than PHP 7, as such I saw what other versions were available by apt and purged the current Xdebug install I had in favor of running "sudo apt install php-xdebug=2.4.0-1" as I saw that version still supported older PHP versions. After this I still had the same issue however so I searched for similar issues.
I tried running "php -m" and "php5.6 -m" and both had different outputs but neither had Xdebug listed under Zend modules. Also ran "php --ini" and the output was
Configuration File (php.ini) Path: /usr/local/lib
Loaded Configuration File: (none)
Scan for additional .ini files in: (none)
Additional .ini files parsed: (none)
"php5.6 --ini" on the other hand outputs:
Failed loading /usr/lib/php/20131226/usr/lib/php/20131226/xdebug.so: /usr/lib/php/20131226/usr/lib/php/20131226/xdebug.so: cannot open shared object file: No such file or directory
Configuration File (php.ini) Path: /etc/php/5.6/cli
Loaded Configuration File: /etc/php/5.6/cli/php.ini
Scan for additional .ini files in: /etc/php/5.6/cli/conf.d
Additional .ini files parsed: /etc/php/5.6/cli/conf.d/10-mysqlnd.ini,
/etc/php/5.6/cli/conf.d/10-opcache.ini....
In case it helps here is the output for "php -v"
PHP 5.4.45 (cli) (built: Nov 15 2017 10:53:58)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
And "php5.6 -v"
PHP 5.6.34-1+ubuntu16.04.1+deb.sury.org+1 (cli)
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
Not sure why "php -v" shows a different version of PHP and Zend Engine than "php5.6 -v" but figured it may be relevant to my issue. Anyways, I checked to make sure "xdebug.so" existed in that directory so I ran "locate xdebug.so"
/usr/lib/php/20131226/xdebug.so
/usr/lib/php/20151012/xdebug.so
In the "php5.6 --ini" output it was clear that some path was getting appended to the one I was adding in my /etc/php/5.6/cli/php.ini file, so I commented out
;zend_extension="usr/lib/php/20131226/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_log="/var/log/xdebug/xdebug.log"
xdebug.remote_enable = On
xdebug.remote_mode = req
xdebug.remote_connect_back = 1
xdebug.profiler_enable = On
xdebug.profiler_enable_trigger = On
After doing that when I run "php5.6 --ini" I no longer get the failed loading error but still Xdebug is no where to be found / used. I used step 4 in Check if xdebug is working to check if it is installed properly and I always get call to undefined function so it's clear the installation is wrong. My end goal here is to get Xdebug set up so I can link it with Sublime but the first step is obviously just getting Xdebug installed on my server.
My hunch is it's something to do with my differences between php and php5.6? I've usually been able to get to the bottom of issues through hunting online but at this point I feel like I've tried most suggestions and genuinely don't know what I should do; my experience with these sort of issues is limited as well. Also https://xdebug.org/wizard.php doesn't help as it just says under PHP 7 isn't supported. Hopefully I've detailed everything I've tried so far, any help or things I could try would be greatly appreciated, also if I can provide any more details to figure this out just let me know.
# php -m | grep mongo
mongo
# php -v
PHP 5.4.7 (cli) (built: Sep 8 2013 20:19:53)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
Any idea? Thanks
PHP mongo driver version is 1.2.12
You can follow the steps in the below link
Installing Mongi Driver for PHP
Also Looks like you are having trouble in loading the driver by adding the line
extension=mongo.so
to php configuration
To do that you need to first locate your php.ini files , normally there will be two files one for command line and one for apache .
Off course you can find it in phpinfo() . If you could not find it then
To know the locations of php configuration
Just run below command
php --ini
This command lists all configuration files which are some times not visible in phpinfo()
Hope this helps
NOTE : - I assume that you are using Linux or Unix environment and not windows . I did this guess by looking at the grep command which you have posted in your code :)
In my PHP 5.4 and Centos 6.3 machine I'm trying to install XCache. From this manual I made every step: http://cgibin.info/php/install-xcache-centos/
Inside /etc/php.ini file I added this, and checked that xcache.so file exists in directory
extension = /usr/lib64/php/modules/xcache.so
then I wrote php -v I get this:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/20090626/apc.so' - /usr/lib64/20090626/apc.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP 5.4.18 (cli) (built: Aug 19 2013 14:10:14)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
with XCache v3.0.3, Copyright (c) 2005-2013, by mOo
with the ionCube PHP Loader v4.4.1, Copyright (c) 2002-2013, by ionCube Ltd.
with XCache Cacher v3.0.3, Copyright (c) 2005-2013, by mOo
But when I check admin panel I see this:
I added XCache entries to /etc/php.ini.
I don't change /var/www/vhosts/system/example.com/etc/php.ini because that file is auto generated by Plesk 11.5
Also when I make phpinfo(), I don't see a XCache part.
After that I added ini directives to /var/www/vhosts/system/example.com/etc/php.ini and it worked. But whenever I update my Plesk settings I will lose the entries inside that file. I don't prefer to use Plesk UI for php.ini settings. Is it not possible to use /etc/php.ini settings rather than writing them to /var/www/vhosts/system/example.com/etc/php.ini
How can I solve this ?
Some part of my php.ini file like this:
Server API
CGI/FastCGI
Configuration File (php.ini) Path
/etc
Loaded Configuration File
/var/www/vhosts/system/example.com/etc/php.ini
Scan this dir for additional .ini files
/etc/php.d
Additional .ini files parsed
/etc/php.d/apc.ini, /etc/php.d/curl.ini, /etc/php.d/dom.ini, /etc/php.d/fileinfo.ini, /etc/php.d/gd.ini, /etc/php.d/imap.ini, /etc/php.d/ioncube.ini, /etc/php.d/json.ini, /etc/php.d/mbstring.ini, /etc/php.d/mysql.ini, /etc/php.d/mysqli.ini, /etc/php.d/newrelic.ini, /etc/php.d/pdo.ini, /etc/php.d/pdo_mysql.ini, /etc/php.d/pdo_sqlite.ini, /etc/php.d/phar.ini, /etc/php.d/sqlite3.ini, /etc/php.d/wddx.ini, /etc/php.d/xmlreader.ini, /etc/php.d/xmlwriter.ini, /etc/php.d/xsl.ini, /etc/php.d/zend_extensions_psa.ini, /etc/php.d/zip.ini
Trante,
Me again. Try adding the xcache.ini to the php.d directory. This may not work for you, as I have read that the xcache extension needs to be loaded before other extensions. However, I have not been able to confirm this as of today. (It is on my test agenda for my recently rolled rpm.)
Anthony
Make a phpinfo() page.
Check the 'extension_dir' and make sure the xcache.so is in this folder.
If it is in there and still not coming up in phpinfo(), check apache error logs, this should tell you if it has trouble loading the extension and what error occurred along the way.
IMO Your better off compiling this from source, it'll be easier to do and you can have direct control over everything.
I have downloaded php_mongo-1.3.2RC1.zip from https://github.com/mongodb/mongo-php-driver/downloads
Then I have extracted all of them in my C:\xampp\php\ext directory. To use mongodb though php file located in 'C:\xampp\htdocs\index.php' directory, I have added extension=php_mongo-1.3.2RC1-5.2-vc9.dll this line to C:\xampp\php\php.ini.
Yet I have got this error Fatal error: Class 'MongoClient' not found. What can I do to make it work?
I am using Xampp on windows 8 64 bit running on php 5.2.
I have tried writing php on cmd and it returns this following lines:
Warning: PHP Startup: mongo: Unable to initialize module
Module compiled with module API=20060613
PHP compiled with module API=20100525
These options need to match
in Unknown on line 0
I have tried phpinfo() as #j0k has asked, and it returned:
Configuration File (php.ini) Path C:\Windows
Loaded Configuration File C:\xampp\php\php.ini
Try this:
pear install -f pecl/mongo
I think you use php 5.4 (info from my web server):
$ php -v; phpize -v
PHP 5.4.11 (cli) (built: Feb 10 2013 03:38:26)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
Configuring for:
PHP Api Version: 20100412
Zend Module Api No: 20100525
Zend Extension Api No: 220100525
API module versions are identical.
…
Module compiled with module API=20060613
…
It is php 5.2 (from source code):
$ grep '#define ZEND_MODULE_API_NO' php-src-php-5.2.17/Zend/zend_modules.h| sed 's/#define ZEND_MODULE_API_NO//'
20060613
Check you version php (php -v; phpize -v) and setup php-mongo-driver. You can see versions in phpinfo(); (recommended; PHP API, PHP Extension, Zend Extension, Thread Safety)
Try to restart your Apache. Apache will not try to reload the configuration upon edit. For xampp you can do this in the cornor pressing shutdown or restart, if I Remember correctly. Alternative you can restart your pc
From this page:
Note: Additional DLL dependencies for Windows Users:
In order for this extension to work, there are DLL files that must be available to the Windows system PATH