HTTP Request Failed without a specific reason - php

We are getting sporadic errors HTTP Request Failed in the Apache Error log but without a further reason.
The requested URL is on the local server.
I made some tests with a wrong URL and host but this leads to other errors for example
failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known.
In the apache error.log:
[DATE] [error] [client XXX.XXX.XXX.XXX] PHP Warning: SoapServer::SoapServer(http://example.com/index.php/api/v2_soap/index/wsdl/1/): failed to open stream: HTTP request failed! in /var/www/lib/Zend/Soap/Server.php on line 762
[DATE] [error] [client XXX.XXX.XXX.XXX] PHP Warning: SoapServer::SoapServer(): I/O warning : failed to load external entity "http://example.com/index.php/api/v2_soap/index/wsdl/1/" in /var/www/live/lib/Zend/Soap/Server.php on line 762
I checked our Apache error log for the SOAP URL that is being called and the return code is "200".
So what can be the reason for this error?

Related

php artisan serve not working (laravel 5.6)

I have some problem when I tried to serve the application on my localhost.
When I run
C:\xampp\htdocs\BePunct>php artisan serve --host=admin.bepunct.test
I received this error
Laravel development server started: http://admin.bepunct.test:8000
[Mon Mar 11 09:37:03 2019] PHP Warning: Unknown: php_network_getaddresses: getaddrinfo failed: No such host is known. in Unknown on line 0
[Mon Mar 11 09:37:03 2019] Failed to listen on admin.bepunct.test:8000 (reason: php_network_getaddresses: getaddrinfo failed: No such host is known. )
This is the my env setting: .env file
I have set on /drivers/etc/hosts to redirect the url to the localhost.
The error simply saying that the requested host is not found.
Please make sure your given host is referring to localhost domain.
127.0.0.1 admin.bepunct.test

HTTP ERROR 500 on installed an existing laravel project

I have installed an existing laravel project but when I run "php artisan serve" command it gives me below error.
PHP Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
[Thu Jul 20 12:07:12 2017] PHP Fatal error: Unknown: Failed opening required '/Users/logicparadisemac/Sites/physicalproduct/server.php' (include_path='.:') in Unknown on line 0

"Failed to open stream: Permission denied" Connecting bitcoind with JSON-RPC PHP

I'm trying to control bitcoin daemon with PHP but I am having an issue when trying to connect to it.
I've followed these steps: en.bitcoin (dot) it/wiki/PHP_developer_intro
PHP code:
<?php
require_once 'jsonRPCClient.php';
$bitcoin = new jsonRPCClient('http://user:password#127.0.0.1:8332/');
echo "<pre>\n";
print_r($bitcoin->getinfo());
echo "</pre>";
?>
Bitcoind conf:
rpcuser=user
rpcpassword=password
server=1
daemon=1
listen=1
var/log/httpd/error_log:
[Tue Apr 06 15:47:15.403045 2015] [:error] [pid 2293] [client 10.0.0.34:50333] PHP Warning: fopen(http://...#127.0.0.1:8332/): failed to open stream: Permission denied in /var/www/html/jsonRPCClient.php on line 132 [Tue Apr 06 15:47:15.410993 2015] [:error] [pid 2293] [client 10.0.0.34:50333] PHP Fatal error: Uncaught exception 'Exception' with message 'Unable to connect to http://user:password#127.0.0.1:8332/' in /var/www/html/jsonRPCClient.php:140\nStack trace:\n#0 /var/www/html/bitcoin_get_info.php(15): jsonRPCClient->__call('getinfo', Array)\n#1 /var/www/html/bitcoin_get_info.php(15): jsonRPCClient->getinfo()\n#2 {main}\n thrown in /var/www/html/jsonRPCClient.php on line 1406
Edit:
$ bitcoin-cli getinfo
Works fine, with PHP it doesn't
Maybe try adding rpcallowip=127.0.0.1 into your config and see what happens.
Also make sure that your bitcoind.conf is actually being used, to test this you can set the daemon to testnet using testnet=1 in bitcoind.conf. Restart your bitcoind server then do bitcoin-cli getinfo to see which network it's connected to. If the change isn't reflected then perhaps the bitcoind.conf file is in another location?
Also, make sure you restart your bitcoind server every time you make a change to the bitcoind.conf file.

Symfony crash after attack (failed opening required)

Almost every week on sunday morning (4am), I receive such error log lines in my debian6 server :
[Sun Nov 23 04:10:05 2014] [error] [client ::1] PHP Fatal error: require(): Failed opening required '/home/mydomain/www.myd\x81\x19\xa8k\xc4n\xf8\xf7H' (include_path='.:/usr/share/php:/usr/share/pear') in /home/mydomain/www.mydomain.com/htdocs/app/bootstrap.php.cache on line 2703
GnuTLS: Handshake Failed (-8) 'A record packet with illegal version was received.'
After about 20 such entries, my website crash completly, and log displays on each visit:
[client 157.55.39.25] PHP Fatal error: Cannot redeclare class Symfony\Component\Routing\RequestContextAwareInterface in /home/mydomain/www.mydomain.com/htdocs/vendor/symfony/symfony/src/Symfony/Component/Routing/RequestContextAwareInterface.php on line 17
It seems that a robot attack includes wrong data in Symfony cache, and the website is then no more able to handle further request.
I have no cron jobs at 4 am which could explains these behaviors.
What could I do ?

Moved Facebook app to a new server, now its broken

My app was working fine on my server. I moved it to another server, updated all the app settings in developers.facebook.com and now all i get is a blank page. The error_log for the server shows this error.
[Wed May 23 22:20:01 2012] [error] [client 184.65.142.249] PHP Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0, referer: http://static.ak.facebook.com/platform/page_proxy.php?v=4
[Wed May 23 22:20:01 2012] [error] [client 184.65.142.249] PHP Fatal error: Unknown: Failed opening required '/var/www/html/explorebc/home.php' (include_path='.:/usr/share/pear:/usr/share/php') in Unknown on line 0, referer: http://static.ak.facebook.com/platform/page_proxy.php?v=4
I've searched high and low for an answer to this, I could really use somebody's help for a push in the right direction.
The paths are right, the facebook settings are right, the init call is in there, the config file has been updated with new server paths.
Cheers,
Cody
You should make sure that the right permissions are set for files. [Source]
It was SELinux that was blocking the site from working correctly. It was unrelated to code or direction, it was just simply blocking things from working.

Categories