Symfony crash after attack (failed opening required) - php

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 ?

Related

sitename.com is currently unable to handle this request. HTTP ERROR 500- Laravel deploy

I am first time deploying my laravel project in a shared hosting.
I got error:
This page isn’t working. jsquarehospital.com is currently unable to handle this request.
HTTP ERROR 500
I deployed following this tutorial https://www.youtube.com/watch?v=6g8G3YQtQt4
Deploy Method: uploaded project zip in root directory, then uploaded the public folder in public_html and changes index.php
Please help me. My error log
[Sun Oct 18 14:00:33.054366 2020] [php7:warn] [pid 24621] [client 103.25.250.225:28241] PHP Warning: require(/home/jsquare/domains/jsquarehospital.com/public_html/../jshpanel/vendor/autoload.php): failed to open stream: No such file or directory in /home/jsquare/domains/jsquarehospital.com/public_html/index.php on line 24
[Sun Oct 18 14:00:33.054390 2020] [php7:error] [pid 24621] [client 103.25.250.225:28241] PHP Fatal error: require(): Failed opening required '/home/jsquare/domains/jsquarehospital.com/public_html/../jshpanel/vendor/autoload.php' (include_path='.:/usr/local/php73/lib/php') in /home/jsquare/domains/jsquarehospital.com/public_html/index.php on line 24

Getting a blank screen after copying a Drupal-7 project to my server

I am fairly new to Drupal.
I just got an already existing Drupal project and want to install it.
I copied it to: /var/www/html/myprojects/mydrupalproject
Then I got this error in my error.log from apache2:
[Thu May 03 17:55:41.603774 2018] [php7:notice] [pid 11604] [client
127.0.0.1:41930] PHP Notice: Constant DATE_RFC7231 already defined in /var/www/html/myprojects/mydrupalproject/includes/bootstrap.inc on
line 258, referer: http://127.0.0.1/myprojects/
[Thu May 03 17:55:41.604601 2018] [php7:error] [pid 11604] [client
127.0.0.1:41930] PHP Fatal error: require_once(): Failed opening required
'/var/www/html/myprojects/mydrupalproject/profiles/clusters_public/modules/contrib/apc/drupal_apc_cache.inc'
(include_path='.:/usr/share/php') in
/var/www/html/myprojects/mydrupalproject/includes/bootstrap.inc on
line 2632, referer: http://127.0.0.1/myprojects/
So I tried to use the original .htaccess info in case it was the problem but I still get exactly the same error in the log. Any help?
Failed opening required
'/var/www/html/myprojects/mydrupalproject/profiles/clusters_public/modules/contrib/apc/drupal_apc_cache.inc'
Does this file exist on your webserver and is it accessable? Are the correct file-rights set?

"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.

Blank page when accessing ../wp-admin and the contents page

I get a blank white page when accessing wp-admin and the contents page.
I'm using openshift hosting and wordpress.
Here's the error log:
[Sat Apr 11 11:11:12 2015] [error] [client 127.4.198.1] PHP Fatal
error: require_once(): Failed opening required
'/var/lib/openshift/5528a392fcf933f54d000067/app-root/wp-admin/includes/plugin.php'
(include_path='.:/var/lib/openshift/5528a392fcf933f54d000067/app-root/runtime/repo/lib:/var/lib/openshift/5528a392fcf933f54d000067/app-root/runtime/repo/libs:/var/lib/openshift/5528a392fcf933f54d000067/app-root/runtime/repo/libraries:/var/lib/openshift/5528a392fcf933f54d000067/app-root/runtime/repo/src:/var/lib/openshift/5528a392fcf933f54d000067/app-root/runtime/repo/vendor:/var/lib/openshift/5528a392fcf933f54d000067/app-root/runtime/repo/vendors:/var/lib/openshift/5528a392fcf933f54d000067/php/phplib/pear/pear/php:/usr/share/pear:/var/lib/openshift/5528a392fcf933f54d000067/app-root/data/plugins/papercut/inc/phpQuery/:/var/lib/openshift/5528a392fcf933f54d000067/app-root/data/plugins/papercut/inc/phpQuery/plugins/')
in
/var/lib/openshift/5528a392fcf933f54d000067/app-root/data/plugins/extrawatch-pro/extrawatch.php
on line 57
How do I fix this?

MySQL is crashing with the error "Lost connection to MySQL server at 'reading initial communication packet', system error: 111

My website crashes at random times because of a problem with MySQL and I can't quite pinpoint it. For one, the crash itself happens very seldom (perhaps once a month) so I can't replicate it. Because of that, I don't know what exactly is causing the issue.
When I first built our site many years ago, I was using mysql_ calls to connect to the database. I learned the error of my ways and started using PDO. Unfortunately, there is a LOT of code that used the mysql_ calls and I haven't gotten around to replacing every single one of them yet. So, my site has a mix between PDO and mysql_ calls.
When the site connects to the database, it first calls mysql_connect() and then connects to PDO through a wrapper.
The error I'm receiving comes into play when I use mysql_connect(). I've dug through logs and I can't find a specific cause for the error. As soon as it happens, it crashes the MySQL server and therefore the website. I can't even assume that mysql_ is the problem because it crashes before it even gets to the PDO wrapper. It might just be a MySQL connection issue.
I've done some searching and it looks like some others have recommended revising bind-address in my.cnf, which I've done.
I've also gone through the website and tried to remove as many mysql_ calls as possible.
Here's some example logfile output, with some info redacted:
Error connecting to database. Reason: Lost connection to MySQL server at 'reading initial communication packet', system error: 111
[Mon Jun 09 13:01:29 2014] [error] [client ****] PHP Warning: Creating default object from empty value in database.php on line 89
[Mon Jun 09 13:01:29 2014] [error] [client ****] PHP Fatal error: Call to a member function setErrorCallbackFunction() on a non-object in database.php on line $
[Mon Jun 09 13:01:29 2014] [error] [client ****] PHP Warning: Creating default object from empty value in database.php on line 89
[Mon Jun 09 13:01:29 2014] [error] [client ****] PHP Fatal error: Call to a member function setErrorCallbackFunction() on a non-object in database.php on lin$
[Mon Jun 09 13:01:29 2014] [error] [client ****] PHP Warning: mysql_connect(): Lost connection to MySQL server at 'reading authorization packet', system error: 0 in $
[Mon Jun 09 13:01:29 2014] [error] [client ****] PHP Warning: Creating default object from empty value in database.php on line 89
[Mon Jun 09 13:01:29 2014] [error] [client ****] PHP Fatal error: Call to a member function setErrorCallbackFunction() on a non-object in database.php on line $
[Mon Jun 09 13:01:29 2014] [error] [client ****] PHP Warning: Creating default object from empty value in database.php on line 89
[Mon Jun 09 13:01:29 2014] [error] [client ****] PHP Fatal error: Call to a member function setErrorCallbackFunction() on a non-object in database.php on lin$
[Mon Jun 09 13:01:29 2014] [error] [client ****] PHP Warning: mysql_connect(): Lost connection to MySQL server at 'reading authorization packet', system error: 0 in $
Any help would be greatly appreciated.
If the MySQL server crashes, then this issue is caused by the MySQL daemon itself and not your client code.
It can't be the database (schema) either, as you don't get to this point. (the DB is selected after succesful connection )
Make sure that:
MySQL binaries are the latest version or at least the latest version that ships via your distribution package management (same for all libs used by MySQL)
the RAM in your server is sound, maybe run a memcheck
the harddisk in your server is sound, maybe run smart utils or a full disk scan

Categories