Hello I am trying to upload a symfony 3 project to the hosting.
The hosting php version is 7.
I am uploading It by FTP beacause I do not have SSH acces and I request to the support of the hosting, and I do not have the right acount for have SSH user.
On localhost with xamp the proyect run perfectly but when I uploaded It, the next issue apears:
Fatal error: Uncaught RuntimeException: Session Storage was not able to create directory "\app/../var/sessions/prod" in var/cache/prod/classes.php:292 Stack trace: #0 /var/cache/prod/appProdProjectContainer.php(2131): Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeFileSessionHandler->__construct('/usr/home/farma...') #1 /vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php(274): appProdProjectContainer->getSession_HandlerService() #2 /var/cache/prod/appProdProjectContainer.php(2170): Symfony\Component\DependencyInjection\Container->get('session.handler') #3 /vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php(274): appProdProjectContainer->getSession_Storage_Native in /vendor/twig/twig/lib/Twig/Loader/Filesystem.php on line 94
I read some problems like these on stack and I tryied change the permission of the forlders making them at 777 however It not work.
Someone know how can I solve these? Or other idea for try?
PD:
Right now looking the structure folder I saw a strange folder.
That folder is "var\logs". I can not delete It also It creates after I try inside symfony project.
On local I do not have that fodler.
Try to clear cache by this command:
bin/console cache:clear --env=prod
Or delete var/cache/ manualy
Related
I recently created a new production deployment for a new Laravel-based system. Initially, I had a few permissions issues with the storage folder that I resolved pretty easily. Once I resolved those, I had the app running correctly, but upon my next deployment (with Envoyer), I ran into a different issue that I haven't been able to pin down.
I'm now getting a fatal PHP error that I wasn't getting before:
PHP Fatal error: Uncaught ReflectionException: Class view does not
exist in
/var/www/Core/releases/20170804125010/vendor/laravel/framework/src/Illuminate/Container/Container.php:719\nStack
trace:\n#0
/var/www/Core/releases/20170804125010/vendor/laravel/framework/src/Illuminate/Container/Container.php(719):
ReflectionClass->__construct('view')\n#1
/var/www/Core/releases/20170804125010/vendor/laravel/framework/src/Illuminate/Container/Container.php(598):
Illuminate\Container\Container->build('view')\n#2
/var/www/Core/releases/20170804125010/vendor/laravel/framework/src/Illuminate/Container/Container.php(567):
Illuminate\Container\Container->resolve('view')\n#3
/var/www/Core/releases/20170804125010/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(708):
Illuminate\Container\Container->make('view')\n#4
/var/www/Core/releases/20170804125010/vendor/laravel/framework/src/Illuminate/Container/Container.php(1139):
Illuminate\Foundation\Application->make('view')\n#5
/var/www/Core/releases/20170804125010/vendor/laravel/framewo in
/var/www/Core/releases/20170804125010/vendor/laravel/framework/src/Illuminate/Container/Container.php
on line 719
I've played around with various permissions, tried manually running composer install/update, npm install/etc. with no resolution. Any thoughts would be greatly appreciated.
After quite a bit of experimentation with no luck, I think I resolved it. The Ubuntu user that was set up for deployment with Envoyer was, by default, deploying everything with the 'envoyer' group permissions. This created a permissions conflict with the actual app permissions on Ubuntu. I updated the default group for the deploying user to 'www-data' and it seems that everything is cleared up now.
I need to upload my symfony 3 project online, but I have only access to ftp. So I did all necessary steps I found:
composer update
Clear the cache for production: php app/console cache:clear --env=prod
Upload all app folder on server
After I open my website I got the following error:
Fatal error: require(): Failed opening required
'/nfsmnt/hosting2_1/a/8/a87b3594-7cfe-459e-ad62-286d2dba2c54/zorbfutbal.sk/web/var..\vendor\symfony\symfony\src\Symfony\Component\ClassLoader\ApcClassLoader.php'
(include_path='.:/usr/php56/lib/php') in
/nfsmnt/hosting2_1/a/8/a87b3594-7cfe-459e-ad62-286d2dba2c54/zorbfutbal.sk/web/var/bootstrap.php.cache on line 1780
I checked the file and I have it there and also set all permissions.
What is confusing me is that path from error before my actual domain name.
"/nfsmnt/hosting2_1/a/8/a87b3594-7cfe-459e-ad62-286d2dba2c54/"
I dont know where it comed from and how to fix it.
Any idea? Thanks
You are absolutely sure you set the file permissions correctly like indicated here:
http://symfony.com/doc/current/setup/file_permissions.html#using-acl-on-a-system-that-supports-setfacl-linux-bsd
The message you posted seems to point to something like that.
Also run:
php bin/symfony_requirements
just to check that you've met all the other requirements.
I'm new with PHP and created a demo rest API so I can test my "in development" Android app to work with API's and Json
Te demo API works fine on my desktop with XAMPP but when I upload the project to my external hosting provider i constantly get errors. Some of them I fixed by myself but now I have error I can't get fixed.
Project information:
- Use MySQL Database
-- Tables are exported from desktop to external host
-- Database connection is updated with the external information
- Use doctrine as ORM
-- Works without any problem on my local setup
The error(s)
[18-Feb-2016 09:36:32 Europe/Amsterdam] PHP Fatal error: Uncaught Doctrine\ORM\Mapping\MappingException: The target-entity DemoApi\src\child cannot be found in 'DemoApi\src\Alert#Child'. in /home/aaapi/public_html/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/MappingException.php:740
Stack trace:
#0 /home/aaapi/public_html/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php(953): Doctrine\ORM\Mapping\MappingException::invalidTargetEntityClass('DemoApi\\src\\chi...', 'DemoApi\\src\\Ale...', 'Child')
#1 /home/aaapi/public_html/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php(198): Doctrine\ORM\Mapping\ClassMetadataInfo->validateAssociations()
#2 /home/aaapi/public_html/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php(177): Doctrine\ORM\Mapping\ClassMetadataFactory->validateRuntimeMetadata(Object(Doctrine\ORM\Mapping\ClassMetadata), NULL)
#3 /home/aaapi/public_html/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php(332): Doctrine\ORM\Mapping\ClassMetadataFactory->doLoa in /home/aaapi/public_html/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/MappingException.php on line 740
I'm sure that the files entity classes exist and are correct else it wouldn't work in XAMPP or are i'am wrong about that?
------------- UPDATE -------------
File permissions are 755 for all folders and 644 for all php files
I deployed my Laravel 4.1 app in Heroku by following this article http://phpartisan.tumblr.com/post/71580870739/running-laravel-4-on-heroku
The static HTML homepage loaded okay but when I am trying to log-in, I am getting the error
SQLSTATE[HY000] [2002] No such file or directory
My local setup is Laravel 4.1 & MySQL.
I don't think there was a database created when I deployed.
Do I need to do it manually? How and what will be my settings then?
thanks!
The problem could be your environment might still point to local. in cli, type heroku run php artisan env to find out.
else, you might wanto run php artisan migrate --env=production to set it to the correct production environment.
you might then encounter another issue like this:
PHP Fatal error: Call to undefined function Symfony\Component\Console\mb_convert_variables() in /var/www/mysite/vendor/symfony/console/Symfony/Component/Console/Application.php on line 1154
Trust me, tt has nothing to do with mb_string module like what this post stated.
Laravel: Call to undefined function Symfony\Component\Console\mb_convert_variables()?
The problem is at environment setting.
First, make sure you have .env.php file at same dir level with composer.json and it is exists in your heroku instance. Since you cant FTP inside, you need to push to repo. But laravel tell you this is git ignored, so you will need to temporary allow it to push to your heroku repo.
Next, you will need to edit the bootstrap\start.php
replace the $env = $app->detectEnvironment(function(){}) to:
$env = $app->detectEnvironment(function() {
return file_exists(dirname(__FILE__) . '/../.env.php')
?
'production'
:
'local';
});
Once you done all these, rerun the migrate command and it will works.
You may follow this link for reference.
Laravel environment config not loading, migration fails - SQLSTATE[HY000] [2002] No such file or directory
I would like to use the Dropbox-PHP API that has recently come under development again. It is located here: http://code.google.com/p/dropbox-php/
I did cloned it with hg clone https://dropbox-php.googlecode.com/hg/ dropbox-php and I get this file structure:
Dropbox/API.php
Dropbox/autoload.php
Dropbox/Exception/Forbidden.php
Dropbox/Exception/NotFound.php
Dropbox/Exception/OverQuota.php
Dropbox/Exception/RequestToken.php
Dropbox/Exception.php
Dropbox/OAuth/PEAR.php
Dropbox/OAuth/PHP.php
Dropbox/OAuth/Zend.php
Dropbox/OAuth.php
examples/accountinfo.php
examples/createaccount.php
examples/download_image.php
examples/getmetadata.php
examples/oauth_workflow.php
examples/uploading.php
But I get this error when trying to run accountinfo.php (or example):
Warning: include(Dropbox/autoload.php) [function.include]: failed to open stream
No such file or directory in dropbox-api/examples/accountinfo.php on line 7
Right, so then I move the Dropbox folder inside of where all the example files are and still get an error message:
Fatal error: Uncaught exception 'Dropbox_Exception' with message 'The OAuth class
could not be found! Did you install and enable the oauth extension?' in
examples/Dropbox/OAuth/PHP.php:36 Stack trace: #0 examples/accountinfo.php(9):
Dropbox_OAuth_PHP->__construct('', '') #1 {main} thrown in
examples/Dropbox/OAuth/PHP.php on line 36
So I'm obviously not doing something right but I have no idea what.
Also saw on the site where it has instructions on installing:
pear channel-discover pear.dropbox-php.com
pear install dropbox-php/Dropbox-alpha
I ran those two commands and it still won't work. I don't usually have any problems coding in PHP but the lack of documentation is a little frustrating.
Update
As noted in the accepted answer below my main problem was not having oAuth installed on the system. I'm running OS X 10.6 - if someone can provide some clear and easy instructions on how to build / install this to work with XAMPP / PHP 5.3 I will accept your answer. I've tried the articles online about using homebrew and such but these are flaky and do not seem to work for me. Guessing I will have to build / install it from scratch.
The Dropbox folder needs to be inside one of the folders in your include_path.
Edit:
Also oauth needs to be "installed" on the system and included in php.ini (when you do phpinfo() oAuth should show up as a module). then things should work.