I am using Swoole server and slim framework, especially this library:
Slim Swoole Link
I have followed the tutorial, and gives me this error:
Fatal error: Swoole\Server::__construct(): swoole_server only can be used in PHP CLI mode. in /Users/powermilk/Documents/Proyectos/prueba/public/index.php on line 48
the line 48 has the below code:
$http = new swoole_http_server("0.0.0.0", 8081);
I don't understand why happens this if I quit the library code everything works nice, but I am not able to run slim with Swoole.
The server is running over Nginx.
I'm the writer of the library.
Yes, you have to create your "front controller"ish file and execute it from CLI.
Sort of, from terminal, "php name_of_your_file.php" and leave it running.
Related
I'm working on using puphpeteer, which is a PHP wrapper for the original puppeteer functionality, to do some automated downloads from a website. I've followed the instructions as they were written in the documentation and tried to create an object:
public function getReport(){
$puppeteer = new Puppeteer;
}
Simply instantiating the object above produces the following error:
Exit Code: 1(General error) Working directory: C:\Users\username\Projects\projectfolder\public
Output: ================ Error Output: ================
node' is not recognized as an internal or external command, operable program or batch file
I did find that the object is just failing to be instantiated in the __constructor(). I can follow the stack trace of the code but none of it is helping me understand what is going wrong, which is that Laravel/artisan do not see node as a valid command.
General notes:
PHP 7.3.9
Laravel 7.1.3
Composer 1.9.0
node v12.16.1
node is in my path as the first variable
using Windows 10
How do I get Laravel/artisan to recognize that I have a node installation for this package?
Do you know the location of node on your system? Try placing it here:
$puppeteer = new Puppeteer([
'executable_path' => "PATH_TO_NODE_HERE"
]);
I am facing the same problem with Laravel/Artisan.
'node' is not recognized as an internal or external command, operable program or batch file
after adding
$puppeteer = new Puppeteer([
'executable_path' => "PATH_TO_NODE_HERE"
]);
Puppeteer generate socket error so I move my project to wamp instead of Laravel/Artisan.
all working fine with out adding 'executable_path' on wamp. better to move your project to Wamp or Xampp server. you can read nesk comment here
https://github.com/rialto-php/puphpeteer/issues/35
I want to run Guzzle on Xampp server, but when I try to run it, I get message:
Fatal error: Class 'Guzzle\Http\Exception\BadResponseException' not found in D:\2 Workspace\5 Aptana\OpenTok\Guzzle\Http\Exception\ClientErrorResponseException.php on line 8
I need it as a part of PHP API for OpenTok project. I can't use composer, so I downloaded it manually, but it doesn't work. I think it can be something with namespace and use.
What should I do to get this working?
I am trying to create tasks using gearman using GearmanClient class from the gearman-php-extensions. I am able to run below program using command prompt-
//php client.php works fine
<?php
$client= new GearmanClient();
$client->addServer();
$task = $client->do("send", "hi");
?>
But I wan't to run this code in some yii controller. It seems like yii is not able to find the path upto GearmanClient class, but why?
Also I am writing the yii programs in eclipse. As php command and eclipse are both using the same php library, my yii controller should work fine. Instead my browser gives errors like-
PHP warning
include(GearmanClient.php): failed to open stream: No such file or directory
#plus some warnings and the yii stack trace.
This is happening because, the process that is handling the php files is not updated with the latest php.ini configuration. So you just need to restart that process.
Therefore:
If php handler is running as a web server module, then you'll need to restart the web server.
If you have php running as a cgi process, then you'll need to restart that process.
I am trying to deploy PHP app with Windows Azure Command Line tool for PHP, but unable to make .cspkg and i'm getting this error:
Runtime Exception: 0: Default document “ServiceDefinition.rd” does not exist in Service directory “ServiceDefinition.csx”!
Error: Unexpected Exit
I have following link for guidelines
http://azurephp.interoperabilitybridges.com/articles/deploying-your-first-php-application-with-the-windows-azure-command-line-tools-for-php
The documentation you are using is OLD and had several issues in past so I would suggest using the latest supported way to create PHP application in Windows Azure:
Download new PHP SDK for Windows Azure which is tested with Windows Azure SDK 1.6. You can download the new PHP SDK from the link below:
http://phpazure.codeplex.com/
Follow the documentation as described here:
http://phpazure.codeplex.com/documentation
Try to use –phpRuntime=”C:\Program Files\PHP\v5.3″ instead of –phpRuntime=”C:\Program Files\PHP”.
i had the some error look here may be you find a solution for your problem :
http://marvelley.com/2011/03/03/24-hours-of-windows/
I'm new to symfony and I am trying to run a simple command on the command line but I get an error message.
When I try to execute the command:
d:\new_xam\xampp\htdocs\sf_sandbox_1_2\sf_sandbox>symfony propel:build-model "
I get the error:
'php.exe' is not recognized as an
internal or external command,operable
program or batch file.
Can anybody help me?
This is a fairly common issue on Windows systems for people new to Symfony and/or PHP. It seems to be an issue with the PHP path. See here: http://forum.symfony-project.org/index.php/m/44895/?srch=php.exe+command#msg_44895
Can you try to use the real path for PHP?
i.e.,
"C:\Program Files\PHP\PHP.exe" symfony propel:build-model
At your Symfony directory.
You should be able to prefix everything with "php".
So instead of symfony propel:build-model you can do php symfony propel:build-model.