I had to setup a new server. During this process I copied my Cake app to the new system. By doing this the path changend from /data/nas/www/htdocs/adfund to /srv/www/htdocs/adfund. Now the app does not start anymore.
I tested console command Console/cake EmailQueue.sender and it came up with this error:
PHP Warning: include(/data/nas/www/htdocs/adfund/lib/Cake/Error/ErrorHandler.php): failed to open stream: No such file or directory in /srv/www/htdocs/adfund/lib/Cake/Core/App.php on line 548
To me this looks like some the app has stored the old path and tries to include from there.
Any idea where this could take place?
Old System: Eisfair
New System: OpenSUSE
You should completly wipe your cache directories. If there are still problems check your .htaccess file if RewriteBase is set wrong.
Related
I created laravel 7 project in my /home/namiq/projects/airblog folder.
After I finished my works I copied project files to /var/www/airblog folder in my pc. When I try to open web site it says
The stream or file "/home/namiq/projects/airblog/storage/logs/laravel-2020-07-18.log" could not be opened: failed to open stream: Permission denied
So what is the problem?
Why it points to old path?
How to change storage folder to point to new path?
Interesting. I usually deploy using git, that's why I always have to do a
composer install
once my files are on the server. Maybe that will help in your case, too?
Maybe also try a
composer dump
To generate new autoload files first.
I have successfully uploaded my symfony app to the server. I have also copied the content of the web folder into the public_html folder of my website. But when I access my app via the www.domain.com I get this error
Warning: require_once(/home/domain/public_html/../app/bootstrap.php.cache): failed to open stream: No such file or directory in /home/domain/public_html/app.php on line 6
Fatal error: require_once(): Failed opening required '/home/domain/public_html/../app/bootstrap.php.cache' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/domain/public_html/app.php on line 6
After researching I found that you can run composer install on the server but my challenge is that I dont know how to run cli command on the server via ssh/cpanel.
Please who will be kind enough to show me the way. This is my first attempt on trying to host a symfony application
When you don't run an composer install your dependencies are missing and the bootstrap.cache.php isn't created. So you have to upload the file and the complete vendor folder.
But i would prefer to take a look at your SSH connection and use the correct way. Otherwise you have to upload every time your complete sources including your vendor folder which can take a lot of time.
And the next think is your path. The components from your Symfony application are normally outside of your webroot. So you have to be sure that you can access that folders outside your webroot.
In some systems you have to allow that before you can use it. Otherwise you have to upload your complete application to your public_html folder and put your domain to the web subdirectory.
When I try to start Laravel artisan on a Command-line using php artisan serve, it works because I get the "Laravel development server started on http://localhost:8000/".
However, when I try to run 'localhost:8000' on my web browser, I get this error:
"Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
Fatal error: Unknown: Failed opening required 'C:\xampp\htdocs\laravel\laravel/server.php' (include_path='.;C:\xampp\php\PEAR') in Unknown on line 0"
In your project folder, the server.php file is missing so you got this error
The solution will to create another project then copy the newly created server.php this will solve it.
Another Solution is:
Open the link: https://github.com/laravel/laravel/blob/master/server.php
Copy all code
Open Notepad and paste your copy code
save Notepad file and set name server.php
Copy the server.php file and paste it inside your Laravel project
Run your project again in browser Now you will not get an error and the Laravel project will work properly.
Try changing your port to 8080. Maybe some other app is already in charge of port 8000 aka port in use.
I also face that problem and after quite a time I become to solve it. it very simple to solve it.
When I copy an old project to new Laravel 5.6 setups. I face this problem.
so you should first install new laravel setup.
copy your previously created project. when you will use php artisan serve. you will see this type of error.
So it's mean in your project folder "server.php" file is missing.
copy this file from other project and paste it your project. it will run.
my problem like this which was I facing solve it by this method.
There are 2 ways to remove this.
FIRST WAY:
(1) copy the server.php from your project folder (
c:\xampp\htdocs\laravel\public\server.php)
NOTE: laravel is name of my project
(2) the file "server.php" which you have copied, paste this file to root folder (c:\xampp\htdocs\laravel)
SECOND WAY:
Trying add this file to root project folder https://github.com/laravel/laravel/blob/master/server.php
I had the same issue, but it was because of bad configuration file paths.php in Boostrap folder (Laravel 4.2).
This Line,
'public' => DIR.'/../public',
It seems the project i cloned had setup the the root of the project to be public, So i removed 'public' and become
'public' => DIR.'/..', and everything worked fine. I hope this will help somebody.
So i can conclude that, on top of missing server.php file as how others have been suggesting, also Public folder path misconfiguration in Bootstrap paths.php or app.php for higher Laravel can result into that error.
So I'm new to Laravel 4, and I'm trying to figure out how to Symlink two parts of my site.
The first is apps/storage
The second is public/cache (this is where an image cache is stored)
I'd like to move both of these to a SSD on my server, however Laravel keeps throwing out an error whenever I try and setup these Symlinks.
That error is:
ErrorException
file_put_contents(/meta/services.json): failed to open stream: No such file or directory
Clearly it's unable to find the filesystem and the symlink isn't working with Laravel. But the symlink DOES work with individual files (such as a jpeg), so I'm positive there is no problem with the initial setup.
To clarify, the document root is set to httpdocs/public (via Plesk settings)
The apps (and framework) are located in the httpdocs folder which is no longer serving as the vhost root.
As I hinted at, it's a Plesk server. The owner belongs to the vhost, and the group belongs to psacln. But I don't think there are any permission/ownership problems, as I've verified the symlinks are working.
Looks like you have messed something else, because the path in the error message looks wrong to me:
file_put_contents(/meta/services.json)
IMO, it should be something like:
file_put_contents(/var/www/webapp/app/storage/meta/services.json)
Because, if you have done the symlink correctly you did something like
mv /var/www/webapp/app/storage /mnt/ssd/
ln -s /mnt/ssd/storage /var/www/webapp/app/storage
PHP is trying to write a file in the root /meta folder, where probably it doesn't have right.
I wrote a little site with Symfony2 and I want to host it on my WebSpace. I only have FTP access, so I can not access any console/terminal!
Problem is: Symfony cannot create the cache directory properly! There might be a permission problem still?!
These are y steps so far:
Uploading my whole project with empty Cache directory (since I can't clean it due to no console)
Changing permissions of cache and logs directories using my ftp client
unmasking console, app.php and app_dev.php like explained here
Adding my IP to the whitelist in the files: config.php and app_dev.php
Checking the config.php to see if my configuration meets symfony's requirements (they do! no major problems!)
Checking PHP settings: PHP 5.3.3-7, SQLite3 and PDO-Driver there!
Opening app_dev.php/_configurator/step/0 concludes into a RuntimeException:
RuntimeException: Unable to create the cache directory (/var/www/userx/html/MySiteSymfony/app/cache/dev/twig/83/4c).
Opening app.php results in a 500 server error and no log file is being created
Someone an idea how to get symfony working?
Go into the app/ folder click "get info" on the cache folder and set the right permissions (make sure to click "Apply to enclosed folders/files").
Finally changed my provider. Seems like its OS was just deprecated.