I am working on a laravel 6 api only application so I am testing the endpoints using postman. I am getting this error when I make request to any of the endpoints
Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
Fatal error: Unknown: Failed opening required 'C:\Elo\apiProject\server.php' (include_path='.;C:\php\pear') in Unknown on line 0
From vscode terminal I can see that the development server starts, accepts then closes as seen below
$ php artisan serve
Laravel development server started: http://127.0.0.1:8000
[Thu Apr 2 21:05:53 2020] PHP 7.4.0 Development Server (http://127.0.0.1:8000) started
[Thu Apr 2 21:05:59 2020] 127.0.0.1:53500 Accepted
[Thu Apr 2 21:05:59 2020] 127.0.0.1:53500 Closing
[Thu Apr 2 21:27:23 2020] 127.0.0.1:53668 Accepted
[Thu Apr 2 21:27:23 2020] 127.0.0.1:53668 Closing
I have no idea why it is closing and no information inside the log file. What could be responsible for throwing such error?
I had the same issue and I think it's related to the port 8000.
Maybe it's already in use or something like this because when I changed the port to 9000 (ie: php artisan server --port=9000) it solved the issue and works just fine now.
I had the same issue.In my case it was when I started to work in the project from another computer and so, I did "git clone".
I solved the problem by creating a ".env" copying the .env.example and then, I executed the command "php artisan key:generate" to generate the new API_KEY, which is mandatory for the start of the server.
Hope it helped you !
Related
Whenever I started php artisan serve it deleted serever.php file. Now I have uninstalled avast antivirus but still it gives this error and does not open the site properly.
PS C:\xampp\htdocs\ecom_proj> php artisan serve
Laravel development server started: http://127.0.0.1:8000
**[Fri Dec 11 12:52:23 2020] PHP 7.4.5 Development Server (http://127.0.0.1:8000) started
[Fri Dec 11 12:52:45 2020] 127.0.0.1:54908 Accepted
[Fri Dec 11 12:52:45 2020] 127.0.0.1:54909 Accepted
[Fri Dec 11 12:52:51 2020] 127.0.0.1:54908 Closing**
First, the example shown only shows communication with a browser. Closing the connection is normal behavior. (Note the port. Your server is running on port 8000).
You should check the antivirus logs what has been removed. It doesn't necessarily have to be just server.php. For example: Eset deleted the file where it found:
//<script src="http://link-to-site-detected-as-abusive">
Have you restored the server.php file in the correct version of Laravel?
Maybe you have a bug in your code.
I am new to Laravel. After installing the composer this problem occurs. I change the port number to 1000 but nothing changed. So don't know what to do.
PS C:\xampp\htdocs\WebDev>php artisan view: clear //view clear Compiled views cleared!
PS C:\xampp\htdocs\WebDev>php artisan serve
Starting Laravel development server: http://127.0.0.1:8000
[Mon Oct 12 22:21:43 2020] PHP 7.4.10 Development Server (http://127.0.0.1:8000) started
[Mon Oct 12 22:22:05 2020] 127.0.0.1:50516 Accepted
[Mon Oct 12 22:22:05 2020] 127.0.0.1:50517 Accepted
[Mon Oct 12 22:22:05 2020] 127.0.0.1:50516 Closing
[Mon Oct 12 22:22:05 2020] 127.0.0.1:50517 [200]: GET /favicon.ico
[Mon Oct 12 22:22:05 2020] 127.0.0.1:50517 Closing
laravel custom port serve,
for example, you want on the localhost:1000
php artisan serve --host=localhost --port=1000
sometimes you got an error, already port uses, for that you should kill process
you can kill php artisan of process
kilall php
that command make kill all PHP process
also, you have other preference
find a process which uses the port, and kill it
for find process for which one port uses
sudo fuser -v -n tcp 8000
you can kill process as such
kill -9 <process-id>
and again call command php artisan serve --port=1000
shortly
php artisan serve --host=localhost --port=1000
I had the same issue and I think it's related to the port 8000. Maybe it's already in use or something like this because when I changed the port to 9000 (ie: php artisan server --port=9000) it solved the issue and works just fine now.
Disable smadav auto block, you can find it on the smadav icon, bottom right conner of your screen
Title says what is my problem, and it would be great if anyone have any idea. I did everything I found online on this topic, but didn't helped.
I reinstalled vps and put debian instead of ubuntu, but same problem. Reinstalled again, but problem is still here, and affect only wordpress. So apache, php 7.2, mysql, everything is fresh.
Wordpress is just downloaded, and it's not about plugins because it's still not installed. Before reinstalling VPS I tried with plugins, themes, php.ini , wp-config and so on... Any idea what can cause this?
Error log:
[Fri Mar 15 15:07:20.921038 2019] [php7:error] [pid 2210] [client IP:PORT] PHP Fatal error: Unknown: Failed opening required '/var/www/html/myweb/index.php' (include_path='.:/usr/share/php') in Unknown on line 0 [Fri Mar 15 15:07:23.889563 2019] [php7:warn] [pid 2207] [client 185.220.101.27:44328] PHP Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0
EDIT: Not affect only wordpress. I just tried to copy simple php file and get error. But I knew it's to php, not to wordpress error.
EDIT 2:
FIXED with : sudo chmod -R 755 ~/site root
When I get errors and saw it's permission problem, it's fixed by:
chmod -R 755 ~/site-root
In Symfony 4, I have one bug when I use:
php bin/console serve:run
[Thu Sep 27 19:11:00 2018] PHP Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
[Thu Sep 27 19:11:00 2018] PHP Fatal error: Unknown: Failed opening required 'C:\Users\user\Documents\Sites\Symfony4\vendor\symfony\web-server-bundle/Resources/router.php' (include_path='.;C:\php\pear') in Unknown on line 0
I use composer install before this command.
I am running Windows 10.
I discovered that Avast quarantined my file. And since I was using it in silent mode, I did not see the notification.
I am trying to create a soap client by passing a url that is hosted on my local machine, my dev environment and I keep getting this error. I use to be able to make this call and it worked just fine.
Basically all I am doing is this
$client = new SoapClient('http://virtual.website.com:81/api/?wsdl');
If I go to the url in a browser it comes up, so I know it is the right location. On the Magento forums there are some similar posts but I don't know that this is a Magento specific problem. Everything they mention as a solution I already have. They say to edit the hosts file for example 127.0.0.1 website.com
I already have this since it is setup as a virtual host.
Here is the error in my error_log
[Fri Jun 04 12:30:37 2010] [error] [client 127.0.0.1] PHP Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://virtual.website.com:81/api/soap/?wsdl' : XML declaration allowed only at the start of the document\n in /usr/local/sites/virtual.website.com/www/CUSTOMSCRIPTS/removeProductImages.php on line 6
[Fri Jun 04 12:30:37 2010] [error] [client 127.0.0.1] PHP Stack trace:
[Fri Jun 04 12:30:37 2010] [error] [client 127.0.0.1] PHP 1. {main}() /usr/local/sites/virtual.website.com/www/CUSTOMSCRIPTS/removeProductImages.php:0
[Fri Jun 04 12:30:37 2010] [error] [client 127.0.0.1] PHP 2. SoapClient->SoapClient(*uninitialized*) /usr/local/sites/virtual.website.com/www/CUSTOMSCRIPTS/removeProductImages.php:6
UPDATE:: I have found that this isn't an issue with SOAP something is adding extra spaces to my XML file.
I had exactly the same problem. I had installed Zend Server (PHP 5.3.9) and was getting the same error. I searched a lot and applied all available solutions but all failed.
Finally, I installed wamp and then run 'Soap Client' script over there and it runs successfully.
Then I reached on this point that Zend Server (PHP 5.3.9) has some default bug in 'Soap Client' Script. I uninstalled Zend Server (PHP 5.3.9) and installed Zend Server (PHP 5.4.11) and runs 'Soap Client' script over there. This time it runs successfully.
Conclusion:
Please use latest PHP version (Zend Server) or (Wamp Server) as, there is default 'Soap Client' bug in some PHP versions, one I mentioned above.
After changing URL settings of Magento or your local environment you should always clear Magento /var/cache/ directory. Usually all weird errors disappear with it.
The answer seemed to be for us that we had not enabled the xmlrpc PHP extension. Once we did that the error went away.
Also the problem could be related to rights on soap.wsdl_cache_dir directory
I solved this on my WAMP setup by enabling the php_openssl extension, since the URL I was loading from used https://.