I have PHP 5.5.6 on my XAMPP and I didn't encounter the error. But after uploading my website to our testing environment the following error occurred:
PHP Fatal Error: Call to undefined function password_verify()
Our testing envt/server has PHP 5.5.9 (I checked it using command php -v)
I also checked the PHP manual and it says nothing to configure and nothing to install when using this functions. Any ideas what might be causing this issue?
password_verify() is built in since PHP 5.5.0 and it's most likely that your server doesn't run the latest PHP version. Be sure to double check the PHP version on your server either via phpinfo() or phpversion().
Please note that your CLI and mod_php (or php-fpm) versions might differ, executing php -v might give you a wrong version number. Create a PHP file and open it with your browser to be absolutely sure.
The reason for the differing versions of the CLI, mod_php and php-fpm are related to the packages which are offered by the operating system and what the actual administrator installed on the system. Personally I prefer to compile PHP on my own and be sure to get best performance but also the same version across the complete system.
Replacement for PHP versions lower than 5.5
https://github.com/superandrew/phpPasswordHashingLib
Related
IE, does PHP use its own, internal version of cURL or does it use whatever it finds in the local OS (Windows 10)? I'm in the unfortunate position of trying to make scripts written in 7.4 work on a permanent home that's saddled with 7.1. Before I force an update of PHP, I want to make sure chasing the right problem. I've searched php.ini and don't see a path to the local file system.
Thanks!
The curl functions in PHP do not call out to a command-line version of curl, but rather to a library which can be integrated into a C program.
This version may be included "statically" when PHP is compiled, be a separate file installed alongside PHP, or use a shared file installed centrally on the server and used by multiple programs. This will be determined by the distribution package of PHP.
To determine the library version used, use the phpinfo() function, or run php -i on the command line (which just runs that function for you) and search for "curl", which will show the version.
I'm not sure what your question is.
IE is not an issue here.
I always keep a script that gives me the current state of PHP.
PHP Manual, phpinfo()
<?php
phpinfo();
?>
phpinfo will return something like this if curl is (likely) installed.
I learned through the process of installing PHP 8.1 in my dev env and configuring it to use curl (and a comment), that PHP does call it's own curl executable, in the case of windows 10: php_curl.dll, and does not make an external call to curl in the operating system.
My fear was I'd go through the process of getting someone to upgrade PHP then have to have ask, again, to have curl upgraded.
Thanks to all who offered input!
yes, but curl is an extension, you need to enable it in php.ini file
I'm trying to get a local development environment setup on my windows machine using valet for windows. It works as intended for laravel and standard applications, but not for installing wordpress. It returns a fatal error.
I'm running php version 7.2.22, laravel valet for windows 2.1.1, mysql version 8.0 and wordpress version 5.2.3. I am trying to move away from a MAMP setup and therefore have gone through the process of setting up valet for windows.
I have checked that the credentials I have provided for the local database are correct, mysql is using port 3306, port 80 is free for valet to use.
After providing the details of my local database (which worked just fine in my MAMP setup) in my wp-config.php file, I try and go through the installation stage, and after I have entered all the correct credentials I receive the following error:
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in C:\Users\...
Now from my understanding and from prior researching, mysql_connect() has been deprecated since php5, however I thought wordpress provided a fallback for this in case people were using 7.2. I am using wordpress version 5.2.3.
I believe that PHP 7.2 hasn't been installed properly. I'd probably check for the existence of the constant below in your wp-config.php file, and if that's non-existant, try re-installing PHP 7.2.
WordPress only uses mysql_connect when it thinks you're running PHP 5.x for backwards compatibility.
Please check your wp-config.php file for the following line:
define('WP_USE_EXT_MYSQL', true);
If you find it, delete the line. Your problem should be fixed.
If you still have the problem, then you incorrectly installed PHP 7.2.x. The error you reported is not possible if you are using PHP 7.2.x and the above line isn’t in wp-config.php.
Source: https://wordpress.org/support/topic/php-fatal-error-uncaught-error-call-to-undefined-function-mysql_connect-in/#post-10569776
NB: If you've installed PHP 7.2 but PHP isn't in your PATH, this may also cause this issue.
Each time I try to use the hash() function, it gives me a fatal error for undefined function hash().
First thing I do is check phpinfo() and see if hash is actually present. Phpinfo() does tell me hash() is available. Doesn't mean it's loaded, so when I check my ini file, the pgsql PDO is commented out yet the PDO is working just fine (I guess the generic PDO is always loaded by default). There is also no entry for hash and I wouldn't know the extension name anyways. But, it should have been installed.
Using PHP 7.0.1 on Mac OS X.11 and I used this website http://php-osx.liip.ch as phpbrew just doesn't want to work right for me.
UPDATE -
I decided to go look inside the directory structure where php is installed and noticed that other extensions have their own INI files in the php.d directory. How does one know if the hash extension requires it's own INI file? Or is this just an easier way to enable extensions without having to tinker with INI production and development configurations?
I figured out the problem. While my page dumps out phpinfo() saying version 7.0.2 with all the needed extensions, my CLI version is still liked to 5.6.16 and missing extensions.
As they say, an assumption is the mother of any screw-up. I assumed the installer for 7.0.2 would rename the Apple provided one and/or link to the newer binary.
I would like to ask about how can I use PHP Blenc on wampserver? I've followed every instructions in here but I got an error saying the PHP Blenc function were undefined
http://www.php.net//manual/en/book.blenc.php
I am using PHP 5.4.12 on 64-bit (so as my wampserver architecture I guess). I also tried the example scripts from above and an undefined function is what I get.
The package can be found here
http://www.php.net//manual/en/book.blenc.php
I've searched through the net and always got redirected to the php.net manual.
I am very grateful if someone can give me a detailed instruction on how to make this PHP Blenc work to encrypt my script
Thank you in advance :-)
I dont see a PHP5.4 64bit option in the download area. So that probably means you have downloaded blenc for PHP5.5 64bit or blenc for PHP5.4 32bit.
Either way its not going to run.
You are either going to have to use the 32bit WAMPServer (Apache/PHP/MySQL) so you can stay on PHP5.4 or upgrade your PHP version to PHP5.5.x so you can stick with 64bit and get a blenc extension that will work.
To be honest, there is no great benefit to using the 64bit WAMPServer and quite a few benefits, like having access to some of the more esoteric PHP extensions, in using the 32bit.
In fact 64bit PHP is still considered 'Experimental' and has not yet been fully converted to 64bit anyway.
I have just switched from a shared hosting environment to a dedicated service and whilst testing my code I am finding that some PHP functions aren't available:
Fatal error: Call to undefined function mb_strtoupper()
I have full access to WHM and I can recompile PHP with a bunch of options. Being new to this, I felt it be better to leave the options I'm not familiar with as their default setting.
PHPINFO() states I am running version 5.2.9 and APACHE 2.2.
Have I missed an option in configuring APACHE - is there something I need to switch on to gain full access to PHP functions?
this is a question better asked on serverfault.com
however, regarding your version you moust likely just have to activate mb extensions
also make sure your php is compiled with --enable-mbstring