Closed qriouslad closed 2 years ago
can u tell which php version are you using ? Also if you could add screenshot.
@sarfraznawaz2005 PHP 7.3. What screenshot do you need? I have it up at https://compatibility-checker.dev.bowo.io/phpcs/
I have never run it online, it works locally for me. Here are few suggestions you can try
This is what I get now:
./vendor/bin/phpcs -psvn /home/{{username}}/webapps/compatibility-checker/wp-content/plugins/plugin-logic/. -d memory_limit=-1 --report=code --extensions=php --parallel=2 --standard=./vendor/phpcompatibility/php-compatibility/PHPCompatibility,./vendor/phpcompatibility/phpcompatibility-symfony/PHPCompatibilitySymfonyPolyfillPHP73,./vendor/phpcompatibility/phpcompatibility-passwordcompat/PHPCompatibilityPasswordCompat,./vendor/phpcompatibility/phpcompatibility-paragonie/PHPCompatibilityParagonieRandomCompat,./vendor/phpcompatibility/phpcompatibility-paragonie/PHPCompatibilityParagonieSodiumCompat,./vendor/phpcompatibility/phpcompatibility-wp/PHPCompatibilityWP --runtime-set testVersion 7.3 --ignore= --no-cache --no-colors --report=full --report-width=120 --STARTED--
--FINISHED--
I tried running locallly using Laragon, and it works! Output below
--STARTED--
Registering sniffs in the PHPCompatibility standard... Registering sniffs in the PHPCompatibilitySymfonyPolyfillPHP80 standard... Registering sniffs in the PHPCompatibilityPasswordCompat standard... Registering sniffs in the PHPCompatibilityParagonieRandomCompat standard... Registering sniffs in the PHPCompatibilityParagonieSodiumCompat standard... Creating file list...
C:\laragon\www\phpcs\testcode : old_code_for_testing.php
25: foo::bar(); 26:
27: mcrypt_cbc("asd"); 28:
29: $bar = &new foo();LINE 29: ERROR Assigning the return value of new by reference is deprecated in PHP 5.3 and has been removed in PHP 7.0 (PHPCompatibility.Syntax.RemovedNewReference.Removed)
27: mcrypt_cbc("asd"); 28:
29: $bar = &new foo(); 30:Time: 2.1 secs; Memory: 8MB
--FINISHED--
So seems there is some other problem or restriction on your server but glad that it worked locally.
I inspected NGINX error log on the server and found this:
2022/03/12 08:56:42 [error] 20959#20959: *40863 FastCGI sent in stderr: "PHP message: PHP Warning: popen() has been disabled for security reasons in /home/{username}/webapps/compatibility-checker/phpcs/output.php on line 51" while reading response header from upstream, client: 202.80.216.155, server: compatibility-checker.dev.bowo.io, request: "POST /phpcs/output.php HTTP/2.0", upstream: "fastcgi://unix:/var/run/compatibility-checker.sock:", host: "compatibility-checker.dev.bowo.io", referrer: "https://compatibility-checker.dev.bowo.io/phpcs/"
Then enabled 'popen' and voila, now it works online. :-)
Sample output below, scanning an old WordPress plugin folder
--STARTED--
Registering sniffs in the PHPCompatibility standard... Registering sniffs in the PHPCompatibilitySymfonyPolyfillPHP73 standard... Registering sniffs in the PHPCompatibilityPasswordCompat standard... Registering sniffs in the PHPCompatibilityParagonieRandomCompat standard... Registering sniffs in the PHPCompatibilityParagonieSodiumCompat standard... Registering sniffs in the PHPCompatibilityWP standard... Creating file list...
/home/{username}/webapps/compatibility-checker/wp-content/plugins/plugin-logic : plugin-logic-fields.php
/home/{username}/webapps/compatibility-checker/wp-content/plugins/plugin-logic : plugin-logic.php Time: 458ms; Memory: 8MB
--FINISHED--
Hi @sarfraznawaz2005
Thank you for creating this library. I'm trying it out at https://compatibility-checker.dev.bowo.io/phpcs/ and removed 'target="_blank"' on the form element. However, output.php is not processing anything. Is something broken, or am I doing something wrong?
Thanks! Bowo