I want run Zotero Data Server according to this documentation
In Setting Up Zotero Data Server step, i run $ sudo ./test_reset command and it give me Reset is successfull. Now run ./test_setup
when i run this command $ sudo ./test_setup it shows this error
PHP Fatal error: Class 'Z_CONFIG' not found in /srv/http/ZoteroDataServer/include/header.inc.php on line 91
And this id my server php -v
PHP 5.5.9-1ubuntu4.4 (cli) (built: Sep 4 2014 06:56:34)
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
what can i do to solve problem?
You have to modify config/config.inc.php and change the first line from <? to <?php ... then you need to modify dpconnect.inc.php and set the password for mysql correctly, do "service memcached restart" to ensure that memcached is running, and then test_setup should work properly. This is what I had to do in RHEL6 ...
Related
I am using PhpStorm for a year and now I want to run my PHP server using the PHP Run menu:
I run the server pushing the green arrow button. Then the console show:
/home/john/.cache/JetBrains/PhpStorm2020.1/plugins/idea-php-latest-plugin/php-v7.3.1/php.sh -S localhost:8080 -t /home/john/my-nice-project/backend/web
Then I go to localhost:8080 in my browser and I see this error:
I execute php -v in my terminal and I can see this:
PHP 7.2.34-18+0~20210223.60+debian10~1.gbpb21322 (cli) (built: Feb 23 2021 16:47:51) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.34-18+0~20210223.60+debian10~1.gbpb21322, Copyright (c) 1999-2018, by Zend Technologies
So maybe the problem is the version of the PHP interpreter: I have 7.2.34 and PhpStorm has php-v7.3.1 configure.
Is there any way to configure the version?
But if I execute this command, it works fine:
php yii serve --docroot="backend/web/"
Add this to your php.ini file:
extension=pdo.so
https://www.php.net/manual/en/pdo.installation.php
Whenever I try to test PHPUnit or composer update, I get this error:
PHP Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 7.4.0". You are running 7.3.19
but when I put on the terminal: source ~/.bash_profile it reads that I have 7.4 on my local machine and all works OK. Is there any solution for that issue, to not need to put every time that command source ~/.bash_profile before every start of the console?
Before run source ~/.bash_profile:
PHP 7.3.19 (cli) (built: Jun 12 2020 00:29:59) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.19, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.19, Copyright (c) 1999-2018, by Zend Technologies
After run source ~/.bash_profile:
PHP 7.4.13 (cli) (built: Nov 30 2020 14:57:43) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.13, Copyright (c), by Zend Technologies
I was facing the same issue, I was using command prompt for laravel artisan commands. Which was showing wrong php version. I closed it and from Xampp Control Pannel Open the Shell for artisan commands and now its detecting the correct PHP Version. It fixed my problem.
I'm using Docker composer with a PHP. When trying to set the interpreter I choose Docker compose, I choose the PHP container and then it fails with the error "Failed to parse script validation output".
If I execute php -v inside the container everything seems fine, I tried to set the full path of the PHP executable but I got the same error.
PHPStorm is 2018.2 and php
php -v
PHP 7.1.22 (cli) (built: Sep 15 2018 03:39:59) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
with Xdebug v2.6.1, Copyright (c) 2002-2018, by Derick Rethans
I am using SublimeText to run PHPUnit tests continuosly. Works great, but now I stumbled upon something strange. I updated to the latest PHP version via Homebrew and if I open a Terminal session and type php -v, this is what I get:
PHP 5.6.7 (cli) (built: Mar 22 2015 19:03:55)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
The shell instance that is used by SublimeText seems not to use this version of PHP. If I do the same there (via writing echo shell_exec('php -v');die(); into a PHPUnit test), I get this:
PHP 5.4.24 (cli) (built: Jan 19 2014 21:32:15)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
I tested around a bit and found out, that automator puts out the same if I run a shell script in \bin\bash shell via automator's 'run shell script' action.
How to tell /bin/bash to use the newly installed PHP version?
When you issue the command $ php, the PATH is searched for the binary. You can find out which one will be executed with the command $ which php.
If you want to explicitly run one or another php binary when multiple ones are installed, use full absolute path to the binary, e.g. $ /opt/php5.6/bin/php.
On Ubuntu machine:
$ php -v
PHP 5.5.10-1~dotdeb.1 (cli) (built: Mar 6 2014 18:55:59)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
with uopz v2.0.4, Copyright (c) 2014, by Joe Watkins <krakjoe#php.net>
with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans
My test.php file is simple:
<?php
exit(1);
I would expect this command php test.php || echo "error" to show "error" but it exits with status code 0.
$ php test.php
$ echo $?
0
But on the same machine the same code, but not in file works as expected:
$ php -r "exit(1);" || echo "error"
error
or
$ php -r "exit(1);"
$ echo $?
1
On different machine (archlinux) with php:
PHP 5.5.13 (cli) (built: May 29 2014 05:46:58)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
All cases work as expected, even when the code is run from file the status code is 1.
This is a true problem because git hooks depends on this status codes and Jenkins and I couldn't google it out.
Could it be somehow config-related? I checked cli php.ini and couldn't find anything suspicious.
The uopz extension is the problem. It "corrupts" the exit code. There was a bug opened about this issue.
You can try to set the configuration uopz.overloads=0 as it was recommended in the bug comments. That, unfortunately didn't work for me. Only disabling the extension fixed the issue.