My dev environment works correctly. But when I switch to production I get this error:
Fatal error: Uncaught exception 'UnexpectedValueException'
with message
'The stream or file "C:/wamp/www/merlin/Symfony/app/logs/prod.log" could not be opened: failed to open stream: No such file or directory' in C:\wamp\www\merlin\app\cache\prod\classes.php on line 4958
What is wrong ?
I have my app folder in
C:/wamp/www/merlin/app/ why symfony search files in C:/wamp/www/merlin/Symfony/app ?
Is file C:/wamp/www/merlin/Symfony/app/logs/prod.log exists? If no, try to create them manually. Also, for testing, change permissions of this file to 777 and permissions of C:/wamp/www/merlin/Symfony/app/logs dir to 777 too. Then try to manually remove all cache in C:/wamp/www/merlin/Symfony/app/cache dir.
Related
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.
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.
When I run phpcs, it prints an error that references the path where my project formerly was located, but is no longer located...
PHP Fatal error: Uncaught exception 'UnexpectedValueException' with message 'DirectoryIterator::__construct(/my/old/directory/public_html/coder/coder_sniffer): failed to open dir: No such file or directory' in /usr/share/php/PHP/CodeSniffer.php:2159
How do I fix the my/old/directory path?
I was able to fix the problem by following the instructions at https://www.drupal.org/node/1419988 under "Install Coder and PHPCS with Composer"
I did not need to do the parts that begin "If you wish to use a different version of coder" and "You can also use a git repository".
http://pyrocms.com/documentation/pyrocms/v3.1#installation/installing-pyrocms/running-the-installer
Getting this error
"An exception has been thrown during the rendering of a template ("file_put_contents(app/default/assets/admin/theme.css): failed to open stream: No such file or directory") in "theme::partials/metadata" at line 24."
What I tried so far?
- changing the permission of storage and bootstrap\chache to 777
- php artisan asset:clear
You need to set the following directories writable by your web server:
storage
public/app
bootstrap/cache
In your case, its public/app that you have missed.
I am trying to move a website from an apache2 site to an Azure hosted site.
I configure Azure as a PHPWebsite. I copied the contents of my site into the Azure site.
I installed Pear PHP Not sure why but I was advised to do it.
I then ran
php composer.phar self-update
and
php composer.phar update
and installed FuelPHP.
Now I am getting this error
Warning: require(\classes\autoloader.php): failed to open stream: No such file or directory in D:\home\site\wwwroot\app\bootstrap.php on line 4 Fatal error: require(): Failed opening required '\classes\autoloader.php' (include_path='.;C:\php\pear') in D:\home\site\wwwroot\app\bootstrap.php on line 4
Any idea how to fix this?
Thanks.
The path \classes\... will find to the absolute path \classes\autoloader.php in the file system in the windows OS, which is not the actual file path.
We need to relative path classes\autoloader.php or absolute full path __DIR__."\classes\autoloader.php" if the file path "classes\autoloader.php" is in the same directory with the bootstrap.php.
Additionally, we can have a simple test on Azure Web Apps to verify the issue:
if you have a classes folder with autoloader.php file and the folder is in the same directory with the test script,
echo realpath('\classes\autoloader.php'); will return empty
echo realpath('classes\autoloader.php'); will return the right full path