Using this little script :
<?php
require 'rb.phar';
?>
I get this error :
*PHP Fatal error: Uncaught exception 'PharException' with message '__HALT_COMPILER(); must be declared in a phar' in /home/site1/rb.phar:8\nStack trace:\n#0 /home/site1/rb.phar(8): Phar::webPhar(NULL, 'index.php')\n#1 /home/site1/index.php(2): require('/home/site1/rb....')\n#2 {main}\n thrown in /home/site1/rb.phar on line 8*
php -v :
PHP 5.4.4-14+deb7u8 (cli) (built: Feb 17 2014 09:18:47)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
with XCache v2.0.0, Copyright (c) 2005-2012, by mOo
with Xdebug v2.2.1, Copyright (c) 2002-2012, by Derick Rethans
uname -a :
Linux lamp 3.2.0-4-amd64 #1 SMP Debian 3.2.51-1 x86_64 GNU/Linux
Can anyone help me get this working, please? I downloaded the latest RedBeanPHP 4 from the website today.
EDIT - as answered by Gabor, removing xcache did get rid of the problem. Here's what I had to do :
mv /etc/apache2/conf.d/20-xcache.ini /etc/apache2/conf.d/20-xcache.ini.disabled
service apache2 restart
If anyone has a better way to disable it (or any other suggestions) please leave a comment.
Thanks.
Might be connected to an issue in XCache:
http://xcache.lighttpd.net/ticket/273
Related
After updating Google App Engine SDK to 1.9.20 I am unable to run local server through PHPStorm 8. I get the following error:
The PHP interpreter specified with the --php_executable_path flag
("/usr/local/bin/php-cgi") is not compatible with the App Engine PHP development environment.
Unable to load GAE runtime module at /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/php55/gae_runtime_module.so
I am running following versions locally
php --version
PHP 5.5.22 (cli) (built: Mar 10 2015 14:17:46)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies
with Xdebug v2.2.7, Copyright (c) 2002-2015, by Derick Rethans
php-cgi --version
PHP 5.5.22 (cgi-fcgi) (built: Mar 10 2015 14:17:49)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies
with Xdebug v2.2.7, Copyright (c) 2002-2015, by Derick Rethans
Here is the error I am getting through PHPStorm:
ERROR 2015-05-18 11:30:04,783 php_runtime.py:353] The PHP runtime is not
available
Traceback (most recent call last):
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/php_runtime.py", line 349, in new_instance
self._check_binaries(php_executable_path, gae_extension_path)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/php_runtime.py", line 290, in _check_binaries
cls._check_gae_extension(php_executable_path, gae_extension_path, env)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/php_runtime.py", line 252, in _check_gae_extension
gae_extension_path)
_PHPEnvironmentError: Unable to load GAE runtime module at /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/php55/gae_runtime_module.so
To my understanding, PHP version 5.5 should be supported, where is the problem?
Assuming you're running on Mac, simply remove the "Path to php-cgi executable" setting in PHPStorm should fix the problem.
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 ...
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.
I am receiving the following error when trying to use the PHP shared memory function shm_attach():
PHP Fatal error: Call to undefined function shm_attach().
I have looked at my php.ini configure command via phpinfo(), and it seems to contain the necessary extensions enabled:
Configure Command => './configure' '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu'
...
'--enable-sysvmsg=shared' '--enable-sysvshm=shared' '--enable-sysvsem=shared'
...
I do not see a reference in my php.ini file to any lines like these:
extension=sysvmsg.so
extension=sysvsem.so
extension=sysvshm.so,
so when I added these to my php.ini file in the hopes that it would possibly do something, it merely threw an error.
In my PHP version on my localhost (Ubuntu), I didn't need to download and install any extensions for these type of functions to work, they were installed be default and worked out of the box.
PHP 5.3.6-13ubuntu3.6 with Suhosin-Patch (cli) (built: Feb 11 2012 02:17:16)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans
The server I am having the issue on is using a different configuration:
Linux version 2.6.35.6-45.fc14.x86_64 (mockbuild#x86-02.phx2.fedoraproject.org) (gcc version 4.5.1 20100924 (Red Hat 4.5.1-4) (GCC) ) #1 SMP Mon Oct 18 23:57:44 UTC 2010
and PHP:
PHP 5.3.8 (cli) (built: Sep 28 2011 17:34:42)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
Any suggestions as to what might have caused the extension to have been installed incorrectly?
Any solutions?
When I call the function readline_callback_handler_install I get an error:
Fatal error: Call to undefined function readline_callback_handler_install() in /home/me/test.php on line 20
But I have php extension readline installed (and all other readline functions gives no error), and my version of php is greather than 5.1
me#laptop:~$ php -r 'echo extension_loaded("readline") . "\n";'
1
me#laptop:~$ php -v
PHP 5.3.3-1ubuntu9.6 with Suhosin-Patch (cli) (built: Oct 14 2011 22:31:56)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans
Does someone know what is happening?
I've had this same error on the ubuntu machines I've tried to use this on.
Just as a note, I know Ubuntu build php using libedit, instead of readline. This may be one cause of the problem.