A few hours ago I installed MAMP Pro 4.0.1 on Windows 10 so far everything was fine until I decided to uncomment pdo_psql.dll inside php.ini to create a connection from PHP to Postgresql but something went wrong, The driver doesn't load it says:
Warning: PHP Startup: Unable to load dynamic library
'C:\php\ext\php_pdo_pgsql.dll' - The module can't be found.
in Unknown on line 0 PHP 7.1.7 (cli) (built: Jul 25 2017 09:24:45) ( ZTS
MSVC14 (Visual C++ 2015) x86 )Copyright (c) 1997-2017 The PHP GroupZend
Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
I found the issue. the thing was that the extention dir wasn't uncommented by default settings so I had to uncomment it in php.ini file.
extension_dir = "ext"
Related
I have 2 php directories. One in C:/ and the other in C:/xampp .
Have I installed php twice or is this normal.
I'am also getting a warning message when I try any php command
php -version
PHP Warning: Module 'fileinfo' already loaded in Unknown on line 0
Warning: Module 'fileinfo' already loaded in Unknown on line 0
PHP 7.4.3 (cli) (built: Feb 18 2020 17:29:46) ( ZTS Visual C++ 2017 x64 )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
Now if I want to edit the php.ini I can't decide which file to edit because in both extension=fileinfo is uncommented
You can open php.ini from below:
I am usign xampp. php version 5.6.28. Thread Safe. opcache disabled.
xdebug version that comes with xampp is 2.2.5
I am running xampp in Windows 10 Enterprise 64 bit.
INI Settings are
[xdebug]
zend_extension=php_xdebug.dll
xdebug.remote_enable=1
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
From the command line php -v I get
C:\Users\733283>php -v PHP 5.6.28 (cli) (built: Nov 9 2016 06:40:27)
Copyright (c) 1997-2016 The PHP Group Zend Engine v2.6.0, Copyright
(c) 1998-2016 Zend Technologies
with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derick Rethans
When I ran the application by enabling xdebug I get session time out error in some line of php code. When I searched I got the following. https://bugs.xdebug.org/view.php?id=1424. It is mentioned that it has been fixed in xdebug version 2.5.4 . From their download page I downloaded the xdebug version php_xdebug-2.5.5-5.6-vc11-x86_64.dll for php version 5.6.2. (They have mentioned both 2.5.4 and 2.5.5 works with php 5.6.2). I copied to the ext folder and modified the php.ini file as
zend_extension = php_xdebug-2.5.5-5.6-vc11-x86_64.dll
I tested this by running php -v from the command line. I got the following.
C:\Users\733283>php -v
Failed loading C:\xampp\php\ext\php_xdebug-2.5.5-5.6-vc11-x86_64.dll
PHP 5.6.28 (cli) (built: Nov 9 2016 06:40:27)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
When I tried their https://xdebug.org/docs/install I can see for php 5.6 the versions of xdebug 2.5 and 2.4 are mentioned. I tried both but got the same above output.
When I tried their testing page it says
Tailored Installation Instructions
Summary
Xdebug installed: no
Server API: Command Line Interface
Windows: yes - Compiler: MS VC11 - Architecture: x86
Zend Server: no
PHP Version: 5.6.28
Zend API nr: 220131226
PHP API nr: 20131226
Debug Build: no
Thread Safe Build: yes
OPcache Loaded: no
Configuration File Path: C:\WINDOWS
Configuration File: C:\xampp\php\php.ini
Extensions directory: C:\xampp\php\ext
PHP version 5.6 is not supported.
But their install page says xdebug version 2.5 works with php v5.6
I have also raised a issue in their website. https://bugs.xdebug.org/view.php?id=1678.
How to make it work?
Yesterday I tried to install php-gd for php7.2.15 on Ubuntu 18.04 lts. Today when Ubuntu got updated it installed php5.6 php7.0 php7.1 php7.3 beside my php7.2. I think I did something wrong but now I just don't want these versions on my server It's a server holding website and app so can't play with it, php -v now shows:
PHP Warning: PHP Startup: Unable to load dynamic library
'pdo_mysql.so' (tried: /usr/lib/php/20180731/pdo_mysql.so
(/usr/lib/php/20180731/pdo_mysql.so: undefined symbol:
pdo_parse_params), /usr/lib/php/20180731/pdo_mysql.so.so
(/usr/lib/php/20180731/pdo_mysql.so.so: cannot open shared object
file: No such file or directory)) in Unknown on line 0 PHP
7.3.2-3+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Feb 8 2019 15:43:57) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine
v3.3.2, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.2-3+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
But phpinfo file is normal not mentioning anything irregular and everything is functioning like normal, but I'd like to keep my server clean so any advice?
Try to find the pdo_mysql.so file manually using find
Edit your php.ini file so it points to the right location of this file.
Most likely php mysql library got overwritten as a result of installation of multiple versions of php. Also make sure you are editing the right php.ini file.
I recently upgraded my VPS PHP version to 7.0.3 and everything seems to work fine including php -v which shows:
(I know I'm getting some warnings but those shouldn't be anything serious)
Failed loading /usr/local/lib/ioncube/ioncube_loader_lin_5.3.so: /usr/local/lib/ioncube/ioncube_loader_lin_5.3.so: undefined symbol: execute
PHP Warning: PHP Startup: suhosin: Unable to initialize module
Module compiled with module API=20090626
PHP compiled with module API=20151012
These options need to match
in Unknown on line 0
PHP 7.0.3 (cli) (built: Feb 14 2016 00:24:25) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
I'm using directadmin and so I created a file index.php in the public_html and this is its content:
<?php
error_reporting(E_ALL);
echo md5("sometext");
phpinfo();
?>
The output is only:
a29e90948f4eee52168fab5fa9cfbcf8
Why are md5 and echo working but not phpinfo???
I'm on Centos and using PHP 7.0.3 with Apache (httpd) 2.4.9
phpinfo() is disabled for free accounts on that particular hosting provider
if youhave access to php.ini
Go to the php.ini and remove phpinfo from
disable_functions =...,phpinfo,....
save and restart webserver
I want to install Composer on my Ubuntu 14.04LTS. But during installation I got this:
Some settings on your machine make composer unable to work properly.
Make sure that you fix the issues listed below and run this script again:
The OpenSSL extension is missing, which means that secure HTTPS transfers are impossible.
If possible you should enable it or recompile php with --with-openssl
Then in php.ini I remove semicolon';' in line ;extension=php_openssl.dll
After this I've got:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20131226/php_openssl.dll' - /usr/local/lib/php/extensions/no-debug-non-zts-20131226/php_openssl.dll: cannot open shared object file: No such file or directory in Unknown on line 0
PHP 5.6.2 (cli) (built: Oct 29 2014 06:55:23)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologies
Where can I get this library?
You use php.ini from windows machine. Use default from package manager. For Ubuntu apt-get.