Error Logging Into Magento 2: Open Source admin panel - php

SO I followed instructions here:
https://www.thecoachsmb.com/6-steps-to-install-magento2-4-2-on-xampp-windows-using-composer/
to install Magento 2 into a fresh install of xammppv3.3.0 running Php7. Once its time to get into the Admin account, It first said the information was incorrect or locked. I ran the commands
(php bin/magento admin:user:unlock <username>)
and
SET #salt = MD5(UNIX_TIMESTAMP());
UPDATE admin_user SET password = CONCAT(SHA2(CONCAT(#salt, 'NewP#ssword'), 256), ':', #salt, ':1') WHERE username = 'adminusername';
all commands came back successful. The I recieve the following:
Error processing your request
So i look into the log and see the following message:
main.CRITICAL: This is not implemented, as it is not possible to
implement Argon2i with acceptable performance in pure-PHP
{"report_id":"33485650bd9de85e8178e26a25bd0f1347c7c9d625b14c2b7167b732b909c9b0","exception":"[object]
(SodiumException(code: 0): This is not implemented, as it is not
possible to implement Argon2i with acceptable performance in pure-PHP
at
D:\xammp\htdocs\magento\vendor\paragonie\sodium_compat\src\Compat.php:1939)"}
[]
According to all searches ive done, this is due to sodium not being used in my PHP, but it is:
the ';' in front of sodium in my php.ini is removed, but I still cant get into magento admin. Any help?

If you are using PHP version 7.4 please switch to PHP version 7.3. For version 7.3 the stability will be higher with the versions of Magento (it is true for the current latest Magento versions)

Are you running php 7.4?
Also, you've removed the ";" from sodium in your php.ini, but have you got the extension installed in XAMPP?
Edit: apologies I've just spotted you have checked the extension is installed. Are you running PHP 7.4 or later?

Related

Magento2 setup error stating i need to change php.ini setting but it is already set

I am trying to set up a Magento 2 app.
I keep getting an error like this:
Your PHP Version is 5.6.31, but always_populate_raw_post_data = 0.
$HTTP_RAW_POST_DATA is deprecated from PHP 5.6 onwards and will be removed in PHP 7.0.
This will stop the installer from running. Please open your php.ini file and set always_populate_raw_post_data to -1.
If you need more help please call your hosting provider.
First of all I have 3 dirs: PHP5.6.31, PHP7.0.23, PHP7.1.9.
So in the PHP 5.6.31 i have 3 ini files all of witch have this setting.
always_populate_raw_post_data to -1
The other 2 folders PHP7.0.23, PHP7.1.9 don't have this in the php ini because it is newer version of php. My question is what can i do to resolve this issue if the php ini does have the correct settings but the install says otherwise?
Well Magento 2.1.11 does not support PHP 5.6.31, but only from 5.6.4 and upper.
Have a look here.
So, try first running
which php
to see which version it is trying to use, then either you can uninstall the 5.6 version and (better) use the php7 version, or be sure it is using the proper one.
Hope it helps.

Debian PHP 5.4.27 vs Ubuntu PHP 5.4.16

Well, I'm transferring a little web server from one computer to other, on the 'other' computer I cannot a more updated version of PHP,
I just have to add my files through ssh and that's all, when I load my webpage it says explicitly:
The error is showing on a Debian with PHP 5.4.27 squeeze, the webserver comes from an Ubuntu with PHP 5.4.16 oneiric
Parse error: syntax error, unexpected '[' in ~directory~ on line 38
This is the line 38.
$VALUE=$DB->query("a nice sentence")->fetch()[0];
So, i was pretty surprised because PDO was accepted since PHP 5.1, so, i look deeper and i found the possible error, you can't simply do ->fetch()[0], you must separate it in order to be "processed",
However, I have transport this server with this information before, so i really don't know if it's something on the configuration of PHP or maybe the version by itself 5.4.X? You guys know any hint? As I said, i can't just install other updated version of PHP5, what do you recommend?
Have a nice night.
Edit: updated to the issue on the PHP 5.4 now
The error seems triggered by the array dereferencing. This was added in PHP 5.4.. Not sure how you made that work in 5.3.6
http://nl3.php.net/language.types.array.php
To workaround you could try
$VALUE = $DB->query("a nice sentence")->fetch();
echo $VALUE[0];
PHP Version on my ubuntu (where it works):
PHP Version 5.4.16
PHP Version on the Debian (where it does not work):
PHP Version 5.4.27-1~dotdeb.0
This version number was extracted by using phpinfo(); on the index page.
Apparently, the error was solved by JUST changing the first issue line (the other hundreds of codes that had that wasn't necessary to change, what i believe to be a little weird).
$VALUE = $DB->query("a nice sentence")->fetch()->offset(0);

MSSQL.so for PHP 5.3 not loading (CentOS 5.8)

I'm trying to install the mssql module for PHP on a server running CentOS 5.8 and PHP 5.3.5. I was able to get it working on the dev server which runs CentOS 5.2 and PHP 5.2.6, and everything seems to match up (FreeTDS installed, module in the modules folder, extension=mssql.so added to php.ini). However, the plugin won't load; doesn't show up in phpinfo() and I get an undefined function error on the test script.
Also of note: phpinfo() lists '--with-mssql=shared,/usr' under the configure command, which is really confusing me.
Solved. Not 100% what the fix was, but I'm pretty sure this was what fixed it.
First off, it probably didn't help I was trying to compile from a copy of php 5.3.16 instead of 5.3.6. Even then, I was running into errors trying to compile it. I found an fix that said to remove this line from php_mssql.h in the folder after it's phpized:
typedef unsigned char *LPBYTE;
I was then abe to do make && make install and it loads with no errors now.

Class 'Memcache' not found & PHP

I installed memcached by reading this article on Windows7 but unfortunately i keep getting error Fatal error: Class 'Memcache' not found in D:\xampp\htdocs\test\memcache\test.php on line 2
Line 2: $memcache = new Memcache;
Win7 64, Xampp Installed. I am using net start "memcached Server" on command line but it says service is already started.
Some other info which may help;
On php.ini file:
extension=php_memcache.dll
[Memcache]
memcache.allow_failover = 1
memcache.max_failover_attempts=20
memcache.chunk_size =8192
memcache.default_port = 11211
Update: phpinfo(); show dll is not loaded. Tried several different dll files so far, didn't work. Also dll is located correct. It is in the right folder as it seems.
(P.S. Some may think there are possible duplicates about this topic but there is only 1 person who followed the same instructions and had same error in SO. That question has no answer or solution since march.)
I found the working dll files for PHP 5.4.4
I don't knowhow stable they are but they work for sure. Credits goes to this link.
http://x32.elijst.nl/php_memcache-5.4-nts-vc9-x86.zip
http://x32.elijst.nl/php_memcache-5.4-vc9-x86.zip
It is the 2.2.5.0 version, I noticed after compiling it (for PHP
5.4.4).
Please note that it is not 2.2.6 but works. I also mirrored them in my own FTP.
Mirror links:
http://mustafabugra.com/resim/php_memcache-5.4-vc9-x86.zip
http://mustafabugra.com/resim/php_memcache-5.4-nts-vc9-x86.zip
Add this to your php.ini:
extension="php_memcache.dll"
and restart apache
Memcached just uses standard text interface so its possible to use it without the module.
// connect
$link = fsockopen($host,$port,$errno,$errst,$timeout);
// set
$data = sprintf("set %s 0 %s %s\r\n%s\r\n",
$key,$expire,strlen($value),$value);
fwrite($link,$data);
$result = trim(fgets($link));
if ($result == 'ERROR') {
// :(
}
// get
$data = sprintf("get %s\r\n",$key);
fwrite($link,$data);
$line = rtrim(fgets($link));
if ($line != 'END') {
return rtrim(fgets($link));
}
So i have looked now for a solution. Here you can download some compiled extensions.
http://downloads.php.net/pierre/
The problem is that at the moment there is no memcache extension for PHP 5.4. this is the problem why your extension could not be loaded. You need the extension for the correct PHP version and Tead Safe for Windows.
So the easiest way is to work with PHP 5.3 if you need the extension.
The newest version of memcache is the version 3.0.6 but its a beta version you can see it here.
http://pecl.php.net/package/memcache
You could try to take the beta version and compile it with your windows system. But its a lot of work.
Also problem can be in loading another version of php module somewhere in apache .conf files. Need to check duplicated "LoadModule php..." directives and if that module compiled to correct version of apache.
It seems sound simply, but not when you have several versions of php on one machine :)
Or it can be SElinux problem too.
xampp windows version is 32bit ,you must be use 32bit memcache.dll
I hole that would be useful for you!

Problem installing cake php

I have installed wampserver on my pc. I unzipped the cake php installation files in the "www" folder of wampserver. Now, when I try to run- "http://localhost/cakephp", I get a whole list of errors along with the cake php getting started page. Here are some of the errors:
Deprecated: Assigning the return value of new by reference is deprecated in
D:\wamp\www\cakephp\cake\libs\inflector.php on line 131
Deprecated: Assigning the return value of new by reference is deprecated in
D:\wamp\www\cakephp\cake\libs\configure.php on line 136
Deprecated: Assigning the return value of new by reference is deprecated in
D:\wamp\www\cakephp\cake\libs\configure.php on line 226
Deprecated: Assigning the return value of new by reference is deprecated in
D:\wamp\www\cakephp\cake\libs\configure.php on line 906
How do I fix this? I got similar errors for codeignite.
Which version of PHP are you running ?
To get E_DEPRECATED errors, it must be PHP 5.3 (which is quite recent) -- and I think the last version of WampServer uses this one.
See :
Predefined Constants
PHP 5.3.0 Release Announcement
As it's pretty recent and brought lots of new stuff, you might run into some kind of troubels (you actually did) with PHP 5.3.... Especially if the software you used is not compatible with it yet.
You might want to downgrade to the previous version of WampServer...
Or you could try lowering the error_reporting level (see also error_reporting), to not get those warnings.
But if you are getting those, you'll probably run into other problems as well...
Actually, after a rapid search into CakePHP's Trac, I found at least those :
Ticket #6026 : php 5.3 needs error_reporting(E_ALL & ~E_DEPRECATED);
Ticket #6500 : PHP 5.3 incompatibility
None of those is solved... So it seems CakePHP is really not ready for PHP 5.3... (It's probably not the only Framework in this situation btw -- Zend Framework v 1.9 which went out couple of days ago is the first version that officially supports PHP 5.3, for instance)
If you want to work with CakePHP, so, you'll probably have to use PHP 5.2.x (like 5.2.9 or 5.2.10).
You're actually not the only one in your situation, it seems... Too bad, as there are pretty nice things in PHP 5.3...
hi I faced the same problem. I have easyphp installed and the latest easyphp is also using php version 5.3. I downloaded cakephp stable version : Release: 1.2.4.8284 Stable. When i opened the web page, i also got the same 'depricated' notices. I also tried mangling with the 'error_reporting' section with no luck.
As I didn't want to downgrade my php 5.3 to an earlier version, I tried CakePHP 1.3-dev. And the problem was fixed.
I am also having the same problem.....I downgraded wamp5 2 to wamp 1.6.0...Now its working perfect
I had similar issue and I installed the 1.3.0-beta and the problem went away...
e
I tried one solution given by Pascal:
https://trac.cakephp.org/ticket/6026
applied this patch and in my case this helped. Thx
I had also same problem but I got resolve by changing in httpd.conf and php.ini
My changes are here-
in httpd.conf
replace
#LoadModule rewrite_module modules/mod_rewrite.so
to
LoadModule rewrite_module modules/mod_rewrite.so
and in tab Directory "{yourdirectoryname}:/wamp/www/">
replace
Order Deny,Allow
Deny from all
to
Order Allow,Deny
Allow from all
in php.ini
make curl ext on. there is no need to run but you should do :)
extension=php_curl.dll
My server and php configuration was
Apache Version : 2.2.17, PHP Version : 5.3.4

Categories