No such file or directory error CakePHP - php

I inherited a CakePHP project and I am having issues getting the project running. I am running into these errors
[Fri Feb 02 00:05:35.920569 2018] [:error] [pid 536] [client 172.18.0.1:38124] PHP Warning: include(/home/tablereserv/web/tablereserv.com/public_html/lib/Cake/Error/ErrorHandler.php): failed to open stream: No such file or directory in /src/lib/Cake/Core/App.php on line 547
[Fri Feb 02 00:05:35.920638 2018] [:error] [pid 536] [client 172.18.0.1:38124] PHP Warning: include(): Failed opening '/home/tablereserv/web/tablereserv.com/public_html/lib/Cake/Error/ErrorHandler.php' for inclusion (include_path='.:/usr/share/php') in /src/lib/Cake/Core/App.php on line 547
[Fri Feb 02 00:05:35.920658 2018] [:error] [pid 536] [client 172.18.0.1:38124] PHP Warning: set_error_handler() expects the argument (ErrorHandler::handleError) to be a valid callback in /src/lib/Cake/Core/Configure.php on line 443
The file path that is trying to be included, /home/tablereserv/web/tablereserv.com/public_html/lib/Cake/Error/ErrorHandler.php does exist and the actual path to that file is /src/lib/Cake/Error/ErrorHandler.php
I have found some similar questions like the ones below, but none of the answers were particularly helpful
CakePHP ErrorHandler error
PHP Warning: include(/var/www/html/....../lib/Cake/Error/ErrorHandler.php): failed to open stream Error
When I print out the CAKE_CORE_INCLUDE_PATH variable, I get the correct path but something is obviously going wrong somewhere and I can’t seem to find it.
I also think I should mention that I set up a docker container to run the project in, I’m not sure if that could have an impact on it.
Any help would be greatly appreciated.

In my case, I found out that file mappings are stored in a file with a name similar to appname_cake_core_file_map. Once I deleted the cache file and ran the request again, a new mapping was generated with the correct path.

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?

making zend tutorial getting error from existing file

THis is my directory in making a zend framework album module
But I am getting this
[Thu Dec 21 14:45:23.609465 2017] [:error] [pid 15352] [client 127.0.0.1:56476] PHP Warning: include(/var/www/html/Profile/module/Album/config/module.config.php): failed to open stream: No such file or directory in /var/www/html/Profile/module/Album/Module.php on line 32
[Thu Dec 21 14:45:23.609500 2017] [:error] [pid 15352] [client 127.0.0.1:56476] PHP Warning: include(): Failed opening '/var/www/html/Profile/module/Album/config/module.config.php' for inclusion (include_path='.:/usr/share/php') in /var/www/html/Profile/module/Album/Module.php on line 32
Now I am confused why I am getting the error when I can see that the file exist in my folder.
I followed the instruction carefully from the docs and copied all the codes
I am wondering why I am getting this error and where I went wrong?
FYI:
Instead of naming zf2tutorial I named mine Profile just to clarify

Understanding Drupal PHP Error Log

My developer team at General Motors has no PHP experience but we have to help with a Drupal/PHP site that went down. I took the 10 lines from the error logs that look important. Could anyone help us understand what's happening from these 10 lines? Any help is appreciated.
PHP Warning: Module 'hash' already loaded in Unknown on line 0
[Sun Jul 23 11:30:04 2017] [notice] Apache/2.2.12 (Linux/SUSE) mod_ssl/2.2.12 OpenSSL/0.9.8j-fips configured -- resuming normal operations
[Sun Jul 23 11:30:05 2017] [notice] Graceful restart requested, doing restart
PHP Warning: Module 'hash' already loaded in Unknown on line 0
[Sun Jul 23 11:30:05 2017] [notice] Apache/2.2.12 (Linux/SUSE) mod_ssl/2.2.12 OpenSSL/0.9.8j-fips configured -- resuming normal operations
[Sun Jul 23 11:30:39 2017] [error] [client 198.208.85.51] ALERT - possible memory corruption detected - unknown Hashtable destructor (attacker '198.208.85.51', file '/www/theblog/index.php', line 19), referer: https://theblog.com/
[Sun Jul 23 22:18:58 2017] [error] Hostname theblock.com. provided via SNI and hostname theblock.com provided via HTTP are different
[Sun Jul 23 22:18:58 2017] [error] Hostname theblock.com. provided via SNI and hostname theblock.com provided via HTTP are different
[Sun Jul 23 22:59:46 2017] [error] [client 198.208.85.51] PHP Fatal error: Call to a member function getElementsByTagName() on a non-object in /www/theblock/modules/filter/filter.module on line 1123
[Sun Jul 23 23:07:21 2017] [error] [client 198.208.85.51] PHP Fatal error: Call to a member function getElementsByTagName() on a non-object in /www/theblock/modules/filter/filter.module on line 1123
Recollecting what was last done might help to resolve your issue. Since in apache error log the showing issue in filter module, check for latest text format if you have updated. (The failing point is when conversion happens from a DOM object back to an HTML snippet). Also verify if you have installed any new module prior to this failure.(if yes try to disable that module using db)

Deploy code from Bitbucket to EC2

I am using BitBucket for my Django project and EC2 for cloud servers. My objective is that when I push a commit to a branch, BitBucket will make a call on the hook and the hook will update the code in EC2.
So far, when I commit, the hook is called but the code isn't being updated on the server. In my understanding, this is to do with permissions in Linux/Ubuntu 14.04.
I have tried to follow the link from Brandon Summers and further refinement of the same by going here. But it still doesn't work.
With the first link, I get this in the log:
fatal: Not a git repository (or any of the parent directories): .git
fatal: Not a git repository (or any of the parent directories): .git
chmod: cannot access '.git': No such file or directory
[Thu Jul 30 18:21:05.106127 2015] [:error] [pid 9736] [client 131.103.20.165:42727] PHP Notice: Undefined property: Deploy::$_data in /var/www/html/deploy_home.php on line 127
And the second link gives me this in console:
[Sat Aug 01 15:26:35.000824 2015] [:error] [pid 2447] [client 131.103.20.165:39102] PHP Warning: file_put_contents(/var/log/deploy/deployments.log): failed to open stream: No such file or directory in /var/www/html/deploy_repo.php on line 144
[Sat Aug 01 15:26:35.000869 2015] [:error] [pid 2447] [client 131.103.20.165:39102] PHP Warning: chmod(): No such file or directory in /var/www/html/deploy_repo.php on line 147
[Sat Aug 01 15:26:35.000924 2015] [:error] [pid 2447] [client 131.103.20.165:39102] PHP Warning: file_put_contents(/var/log/deploy/deployments.log): failed to open stream: No such file or directory in /var/www/html/deploy_repo.php on line 152
[Sat Aug 01 15:26:35.001010 2015] [:error] [pid 2447] [client 131.103.20.165:39102] PHP Warning: file_put_contents(/var/log/deploy/deployments.log): failed to open stream: No such file or directory in /var/www/html/deploy_repo.php on line 144
[Sat Aug 01 15:26:35.001034 2015] [:error] [pid 2447] [client 131.103.20.165:39102] PHP Warning: chmod(): No such file or directory in /var/www/html/deploy_repo.php on line 147
[Sat Aug 01 15:26:35.001068 2015] [:error] [pid 2447] [client 131.103.20.165:39102] PHP Warning: file_put_contents(/var/log/deploy/deployments.log): failed to open stream: No such file or directory in /var/www/html/deploy_repo.php on line 152
sh: 1: /usr/sbin/sendmail: not found
The second link's console output has something to do with unable to write to the log file but still the repo folder remains unchanged on EC2.
What am I missing here?
First, I guess you are missing the deploy directory in var/log. Try to create it manually. In this way at least you will have some log files to analyze.
Second, you haven't shown your script here but it's worth mentioning this script is using the older Bitbucket IP; if you haven't changed it yet, try to replace the IP in this line,
private $_repositoryIp = array ( '63.246.22.222');
with one of the new IP addresses you can find here.
Third, why all the effort when you can CI tools like Jenkins? Some useful posts: 1, 2.

Categories