Drupal throwing blank update.php file - php

I'm updating drupalfrom 7.32 to 7.33
I followed the steps here for updating drupal 7:
https://www.drupal.org/node/1223018
I also followed the step that mentioned to set $update_free_access to TRUE (temporarily) while updating.
But, when I visit mysite.com/update.php it is still throwing a completely blank page.
I also verified in settings.php that:
the file had the database configuration values
Verified that actual data still existed in this database.
What gives? Are there any other solutions to fix this ? (Without having to do a complete clean install)
UPDATE
Errors in error.log are:
PHP Fatal error: Unknown: Failed opening required
PHP Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0
Thanks!

This was an permissions error. I had, had all files not on 755.
I had files having octets of 600 to 777 and they needed to be changed to 755 with:
sudo chmod 755
I followed "KeithM"'s advice on directory permissions here: https://drupal.stackexchange.com/questions/26131/correct-permission-for-site-default-and-files-folders

Related

PHP Error "Unknown: failed to open stream... in Unknown on line 0..." when editing php files

I get a strange php error:
2022-03-14 10:52:19: (mod_fastcgi.c.421) FastCGI-stderr: PHP message:
PHP Warning: Unknown: failed to open stream:
No such file or directory in Unknown on line 0
PHP message: PHP Fatal error: Unknown: Failed opening required
'var/www/vhosts/webdev/sites/test/hello.php'
(include_path='.') in Unknown on line 0
Long explanation:
I create a file hello.php in my webroot, having the content:
<?php echo("hello"); ?>
I run this file in a browser, all is fine, it shows "hello"
Now I edit this file so the content now is:
<?php echo("hello"); echo("world"); ?>
I run this edited file in a browser => The error is shown
I reload the page (F5 or ctrl-R) => all is working fine now
In other words:
Whenever I edit a php file and try to run it in a browser, I get this error message. After reloading the page it works!
That is the real strange thing, after reloading everything is working fine!!!
My config
a local raspberry pi running raspbian
webserver: lighttpd (standard install from repo)
php7.3-fpm (standard install from repo)
all file permissions in my web dev folder are 775, all files are www-data:www-data owned
NO selinux running (like in other answers suggested)
the php.ini is pretty much untouched, some options:
auto_prepend_file =
auto_append_file =
include_path = "."
there are no other hidden config files in the folder
With html files there are no problems. So it must be a php-fpm problem.
I am out of ideas now. It might be a very easy fix, but I am not a Pro.
Any ideas how to fix this?
In the error log, the path doesn't start with a slash "/"
var/www/vhosts/webdev/sites/test/hello.php
which indicates a misconfiguration in lighttpd/fastcgi configuration
Fixing the path should make everything work correctly.

laravel on cpanel raise error for autoload_real.php on line 66

I am new to laravel and I run my website on localhost. It runs correctly but when I upload it on cpanel, it raises these errors :
Warning:
require(/home/didfilei/public_html/app/vendor/composer/../symfony/polyfill-mbstring/bootstrap.php): failed to open stream: No such file or directory in
/home/didfilei/public_html/app/vendor/composer/autoload_real.php on
line 66
Warning:
require(/home/didfilei/public_html/app/vendor/composer/../symfony/polyfill-mbstring/bootstrap.php): failed to open stream: No such file or directory in
/home/didfilei/public_html/app/vendor/composer/autoload_real.php on
line 66
Fatal error: require(): Failed opening required
'/home/didfilei/public_html/app/vendor/composer/../symfony/polyfill-mbstring/bootstrap.php'
(include_path='.:/opt/cpanel/ea-php71/root/usr/share/pear') in
/home/didfilei/public_html/app/vendor/composer/autoload_real.php on
line 66
I solved it. I realized that after extracting the zip file with cpanel, some folders were deleted (eg '/ symfony'), so I got more space from the hosts, then my project extract correctly
Since you do not have access to SSH, you should upload the vendor files along with the rest of your project.
Be careful that if your dev machine is windows, you might face some issues with paths and case sensitivity.
You also need to check how php is executed in your host. You might have to fiddle around with file ownership and access rights.
Especially if suphp is used, your user must be the owner of everything in your folder, all files must be set to 644 and all folders to 755
SSH into your server and run composer update in the root of your project. This will pull in the required vendor files that you are missing.

php-file responding correctly in local mode throws "fatal error" via http

my tests with tcpfd run well as long as in terminal mode.
(see 1. and 2.). they don't when browser calls the same file via http (3.):
why?
local apache2 lists the file with appropriate rights:
tcPDFv6213 # ls -l include/tcpdf_font_data.php
-rw-r--r-- 1 root root 313432 Dez 2 2016 include/tcpdf_font_data.php
starting rechnung.php via php provides the demanded rech.pdf correctly
tcPDFv6213 # php rechnung.php >rech.pdf (what is not under focus here)
unfortunately the same will not provided if invoked via http:
http://localhost/html/platzhalter.One/tcPDFv6213/rechnung.php
the call provides me with "warning" and "fatal error".
Warning: require_once(/var/www/html/platzhalter.One/tcPDFv6213/include/tcpdf_font_data.php): failed to open stream: Permission denied in /var/www/html/platzhalter.One/tcPDFv6213/tcpdf.php on line 113
Fatal error: require_once(): Failed opening required '/var/www/html/platzhalter.One/tcPDFv6213/include/tcpdf_font_data.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/html/platzhalter.One/tcPDFv6213/tcpdf.php on line 113
i tried to chmod root:root to www-data:www-data and v.v.
then i tried to chmod rights for other to 6 and finally to 7.
all that without any success - the error throwed remains the same ..
my system is linux (ubuntu) and mostly running well
edit: after chmod folder include to 755 (see comments, thans martin)
the response to http://localhost/html/platzhalter.One/tcPDFv6213/rechnung.php changes from fatal error to warnings (concerning image related functions).
The issue reported here in my question has been solved. thank you, martin.

The stream or file "/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied

When I navigate to Laravel app on my CentOS server, it gives HTTP ERROR 500
So, when I checked my server error log, it says this error
PHP Fatal error: Uncaught UnexpectedValueException: The stream or file "/var/www/html/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied in /var/www/html/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:107\nStack trace:\n#0
I have already set 777 permission to storage and bootstrap directories.
This very Laravel application runs fine on another server. So, what's the big deal here ?
This error can be fixed by disabling SE-Linux.
Check if it has been enabled by typing...
$ sestatus
So, disable it by typing...
# setenforce 0
It is said that the system needs to be restarted to to take effect the changes.
However, for me, restarting Apache was enough and fixed the problem :-)
Hope this helps!
If your application is laravel and you use sail so add these lines in end of .env file:
WWWGROUP=1000
WWWUSER=1000
I know its late to answer but maybe helps for others.

XAMPP Permission Denied for Require_Once Mac OS X Yosemite

Problem:
I'm trying to open headerr.php via require_once on a XAMPP localhost server. I'm calling this function through index.php but I keep on receiving the following error message
Errors:
Warning: require_once(/Applications/XAMPP/xamppfiles/htdocs/Baseline/headerr.php): failed to open stream: Permission denied in /Applications/XAMPP/xamppfiles/htdocs/Baseline/index.php on line 2
Fatal error: require_once(): Failed opening required 'headerr.php' (include_path='.:/Applications/XAMPP/xamppfiles/lib/php') in /Applications/XAMPP/xamppfiles/htdocs/Baseline/index.php on line 2
Attempted Solutions:
-I've tried setting the permissions to Read & Write for everyone on the (/Applications/XAMPP) Folder but that hasn't fixed the permissions issue.
-I've also tried using require_once dirname(FILE) . '/headerr.php'; but that didn't work either..
In Conclusion:
I suspect that I may have to edit the php.ini file but I have no clue what to do..
I appreciate any advice or insight, thanks!
Try this command:
chmod -R 775 yourWebFolder

Categories