I followed the instructions on this page for installing the SDK and running "Hello, World!". The following error is shown on my localhost:8080
Notice: Use of undefined constant GAE_INCLUDE_REQUIRE_GS_STREAMS - assumed 'GAE_INCLUDE_REQUIRE_GS_STREAMS' in /Users/mhmhsh/google_appengine/php/sdk/google/appengine/runtime/Setup.php on line 32
Hello, World!
I haven't found any thing related to this error on google. It seems that the constant 'GAE_INCLUDE_REQUIRE_GS_STREAMS' is not defined anywhere else in the package. Why haven't others reported the same issue?
I believe there was a glitch in the just-released 1.8.1 SDK for PHP, and that the fix is to edit /google/appengine/tools/devappserver2/php/setup.php, adding the following to the $setup function definition:
$allowed_buckets = ini_get(
'google_app_engine.allow_include_gs_buckets');
define('GAE_INCLUDE_REQUIRE_GS_STREAMS',
// All values are considered true except the empty string.
$allowed_buckets ? 1 : 0);
(I'll confirm and update this message).
I expect that a new version of the SDK will be uploaded very soon that fixes that issue.
Update: yes, this is the correct patch. The SDK for the next release, which fixes this, should be available within a few weeks.
Related
Few weeks ago I set up a Message system with Symfony Messenger and it worked great.
Today I wanted to create new object through message, so I went to my server and type the command to consume message
First I had this result
$ bin/console messenger:consume-messages amqp_notifications
/usr/bin/env: ‘php\r’: No such file or directory
It never happened before with my files, and I never changed the line ending or encoding of my file sin PHPstorm.
I tried to use $ php bin/console messenger:consume-messages amqp_notifications
but then I had this error.
Attempted to load class "AMQPConnection" from the global namespace.
Did you forget a "use" statement?
Pretty weird, because I have have the php-amqp ext installed as you can see on the screenshot of my phpinfo
I didn't change anything in my Message class or Handler.
Also, I tried to call new AMQPConnection() on a random action, just to try, and I didn't get the error.
I'm completely lost with this error this time, as everything is installed.
I use PHP 7.3.1 and symfony Messenger 4.2.2
It seems your second issue was already solved by ccKep on his comment.
The first one is that the specific shebang line #!/usr/bin/env php executes the first php found in the $PATH. So if you already have uninstalled it, which seems the case, or it has a symbolic link to another php version, you can get a wrong result.
Tries to check what is inside the $PATH and replace the PHP path for the correct one. You might get the place running which php.
I have been using the web based bibliography management system aigaion2 for some years, accumulating thousands of references & linked pdf files. However after upgrading from ubuntu 12.04 to 14.04 - with a change in the version of PHP - this fails to give me a log-in screen. There are 2 warning messages;
I am at a loss how to deal with this - does anybody have this working with a recent PHP version or might have any idea how to fix this. From the aigaion website, it seems the package does not have any active maintainers any longer.
A PHP Error was encountered
Severity: Warning
Message: Creating default object from empty value
Filename: gettext/gettext.inc
Line Number: 195
A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at /data1/aigaion2/codeigniter/libraries/Exceptions.php:166)
Filename: helpers/url_helper.php
Line Number: 541
I'm trying to use Aigaion too. I got some errors.
You will find new release here :
On source.forge : Source.Forge
This release replaces old php "commands" to some new ones
eregi to preg_replace
split to explode, etc.
It seems that a 2.5 beta exists :
Release 2.5 beta
I'll check today.
For your problem, I did a small update in the module aigaion2\aigaionengine\libraries\gettext\gettext.inc ligne 193
function _bind_textdomain_codeset($domain, $codeset) {
global $text_domains;
/*
* MVT 150505 : Add !isset due to warning errors
* It is a temporary features. It should be better
* to migrate to a new PHP Release
* Tested with Xamp / Php 5.6.8
* I did this patch in order to use Aigaion with no errors
* I don't have a large knowledge in PHP. Sorry
*/
if (!isset($text_domains[$domain]))
$text_domains[$domain] = new stdClass();
$text_domains[$domain]->codeset = $codeset;
}
I found an answer here :
Empty objects
This should be a little patch...
further development of aigaion is being made at http://github.com/aigaion. This verison is compatible with php7, besides not fully updated.
After I run composer update on AWS PHP SDK I started to get this error:
Fatal error: Interface 'Guzzle\Common\HasDispatcherInterface' not found in <path>
There is HasDispatcherInterface.php file in <path>, but I still get the error. Is this a bug? If it is, is there any workaround?
So it turned out this is about a 12 year old bug of PHP. https://bugs.php.net/bug.php?id=18556
When you use setlocale('tr_TR'), PHP can not find any class or method has an 'I' letter in its name. Even if its a standart library. Great.
After following the user guide instructions found here: http://ellislab.com/codeigniter/user-guide/general/cli.html I'm unable to run the test script via command line.
My controller located at /var/www/mysite/application/controllers/
class Tools extends CI_Controller {
public function message($to = 'World')
{
echo "Hello {$to}!".PHP_EOL;
}
}
In my browser I can access
http://mysite/tools/message/ben
And the function correctly outputs "Hello ben"
From terminal I should be able to run:
$ php index.php tools message "Ben"
My terminal should print: "Hello Ben"
However I get the following error:
PHP Fatal error: Class 'CI_Controller' not found in /var/www/mysite/system/core/CodeIgniter.php on line 233
My server is pretty standard; ubuntu LAMP. Codeigniter is pretty standard too and I have no problem running non CI scripts via command line
My PHP binary is only located in /usr/bin/php <-- This post suggests an issue running CI directly from usr/bin/php, however I'm not operating a shared PHP service, and I don't see why this would make a difference to how PHP executes a CI script.
Any help or just an indication on how to debug this would be greatly appreciated.
Thanks in advance.
Solved! (partly) the issue was CodeIgniters error logging.
In application/config/config.php, I modified the following config property:
$config['log_threshold'] = 0;
This disables logging, and allows $ php index.php to execute.
If anyone can explain why CI only shows this error on CLI PHP - might help anyone else who has this issue and needs it resolved with error logging on.
To solve error "Class 'CI_Controller' not found" try going to Application -> Config -> database.php then check the database details like hostname, username, password and database.
To Mijahn:
I had this same problem, and after about two hours of tracing through code to figure out the problem, it seems that there is some sort of conflict with loading the CI_Controller when utilizing the native PHP load_class function.
I worked around this issue by making the following changes to the Common.php file (hack, I know).
//$_log =& load_class('Log');
require_once('system/libraries/Log.php');
$_log = new CI_Log();
My logs then where created exactly like I wanted. Hope this hack helps.
This site says to run codeigniter from the command line, one must set the $_SERVER['PATH_INFO'] variable.
$_SERVER['PATH_INFO'] is usually supplied by php when a web request is made. However, since we are calling this script from the command line, we need to emulate this small part of the environment as a web request.
The answer provided in this Stack Overflow post worked for me.
Within system/core/CodeIgniter.php, on around line 75, change:
set_error_handler('_exception_handler');
to...
set_exception_handler('_exception_handler');
Other users have reported that this gave them a better backtrace with which to debug the underlying issue, but for me, this actually removed the problem altogether.
I'm using XAMPP with PHP 5.3.1 on my local server, my Cake project use "1.2.0.6311 beta", was all ok, but now i get this error msg
Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\htdocs\rh_pura\cake\libs\debugger.php on line 100
Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\htdocs\rh_pura\cake\libs\cache\file.php on line 91
Fatal error: Class 'Router' not found in C:\xampp\htdocs\rh_pura\cake\dispatcher.php on line 333
in my other server is all ok too, can someone help me?
I Solved:
Open cake/libs/configure.php and find the line "error_reporting(E_ALL);" replace that line with the following:
error_reporting(E_ALL &
~E_DEPRECATED);
And about the fatal error, just deleted all the files in /tmp
Thanks! :)
The first two are just warnings and can be ignored. Basically the code is doing osmething like
$myobj =& new SomeObj;
which in PHP5 is no longer necessary - objects are passed around as references by default and the & is no longer necessary.
The fatal error, however, is unfixable as-is - somewhere you're missing a cake class file (not included? not installed?)
if you are just starting with cake, which it seems is the case, you should not be using 1.2 beta, instead checkout 1.3.7.
Even if you are not new to cake, and this is an already existing application you should be using 1.2.9 the upgrade should be painless as there is nothing that breaks backwards compatibility for minor releases.
You should always be using cake as a git repo, so you can just check out what ever version you like and try it.