Problems with PASSWORD_ARGON2I in PHP 7.3.6 - php

I read that there is a problem with PHP 7.2 and if you want to use ARGON2 you need to compile php using –with-password-argon2
In my case I'm using PHP 7.3.6
php -v
PHP 7.3.6 (cli) (built: Jun 22 2019 11:43:32) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.6, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.6, Copyright (c) 1999-2018, by Zend Technologies
with Xdebug v2.7.2, Copyright (c) 2002-2019, by Derick Rethans
If I try:
var_dump(password_hash('password', PASSWORD_ARGON2I));
it returns:
PHP Warning: Use of undefined constant PASSWORD_ARGON2I - assumed 'PASSWORD_ARGON2I' (this will throw an Error in a future version of PHP)
More info: MacOS Sierra

Related

Problem installed two different PHP on a Mac

I have a strange problem with Mac OS. Problem mixing two versions.
When I look at the PHP version through the VSCode:
When I look at the PHP version through the terminal:
~ » php -v
PHP 8.1.0 (cli) (built: Nov 28 2021 02:36:02) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.0, Copyright (c) Zend Technologies
with Zend OPcache v8.1.0, Copyright (c), by Zend Technologies
When I run a page of code in XAMPP containing phpinfo();
PHP Version 8.0.6
This program makes use of the Zend Scripting Language Engine:
Zend Engine v4.0.6, Copyright (c) Zend Technologies
with Xdebug v3.1.1, Copyright (c) 2002-2021, by Derick Rethans
I just want to have PHP installed on my system. What is the solution to my problem?

Install V8JS on Mac Catalina

I've been trying to install php v8js on my Catalina for a week now. Can you help please? I tried all kind of command line steps. No luck.
php -v
PHP 7.4.0 (cli) (built: Nov 29 2019 16:18:44) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.0, Copyright (c), by Zend Technologies

composer selfupdate Connection reset by peer

I use ubuntu in windows, and when i run composer selfupdate composer send me an error
[Composer\Downloader\TransportException]
The "https://getcomposer.org/versions" file could not be downloaded: SSL: Connection reset by peer
Failed to enable crypto
failed to open stream: operation failed
It's the same error in debian for windows.
But when i running composer selfupdate on powershell of windows
i don't have any error.
conf ubuntu
php -v
PHP 7.0.28-0ubuntu0.16.04.1 (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.28-0ubuntu0.16.04.1, Copyright (c) 1999-2017, by Zend Technologies
with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans
conf debian
php -v
PHP 7.1.18-1+0~20180611145904.18+stretch~1.gbp2b32f6 (cli) (built: Jun 11 2018 14:59:07) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.1.18-1+0~20180611145904.18+stretch~1.gbp2b32f6, Copyright (c) 1999-2018, by Zend Technologies
conf windows
Windows 10 pro
Version 1803
Version OS 17134.1
php -v
PHP 7.0.23 (cli) (built: Aug 29 2017 06:13:57) ( ZTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
Try to disable your antivirus, or try to whitelist that connection depending on which client you're using.
I already had this problem with Kaspersky.
Once disabled, the problem flew away.

constant cannot be resolved on a server

constants.php
<?
define('GREETING', 'Hello World');
?>
index.php
<?php
require("constants.php");
echo GREETING;
?>
This code gives me an error : PHP Notice: Use of undefined constant GREETING - assumed 'GREETING'
(Server 1 - Not Working) Ubuntu 14.04
PHP 5.5.9-1ubuntu4.14 (cli) (built: Oct 28 2015 01:34:46)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
(Server 2 - Working) CentOS 6.3
PHP 5.4.13 (cli) (built: Mar 14 2013 08:57:49)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
with the ionCube PHP Loader v4.6.0, Copyright (c) 2002-2014, by ionCube Ltd.
(Dev Environment - Working) Windows 8.1
PHP 5.5.9 (cli) (built: Feb 5 2014 13:02:39)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
with the ionCube PHP Loader v4.5.3, Copyright (c) 2002-2014, by ionCube Ltd.
What could be the problem and how do I make it work for Server 1?
Previous programmer made used of short tags which turned the block into a comment

Why PHP in CLI need a few seconds to start?

I got problem. My PHP 5.5.8 need a few seconds to start.
If in terminal run this command php -v, it will print version only a few seconds later (about 13). But second run prints it immediately. If i wait a little bit all the same.
What to do?
$ time php -v
PHP 5.5.8 (cli) (built: Jan 12 2014 18:50:29)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies
with Zend OPcache v7.0.3-dev, Copyright (c) 1999-2013, by Zend Technologies
with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans
real 0m13.375s
user 0m0.029s
sys 0m0.024s

Categories