Unable to write cache folder for smarty project on pagodabox - php

I have created project in smarty and now i am trying to host it on pagodabox.com. I have created application on pagodabox.com and uploaded all code on to this application but problem is this now i am unable to configure cache and compiler directory in pagodabox.com that's why it output fetal error because cache and compiler directory is read only mode. I have try Boxfile to resolve this issue but failing to solve. I am not aware how i can make these directory writable. please help me. this is url of project http://moviestock.pagodabox.com/ and following is my Boxfile configuration
web1: #component type & number
name: blog #component settings
shared_writable_dirs:
- var/secured/cache
- var/secured/compiler
- var/sessions
document_root: app
php_version: 5.3.8
and i am getting this following error :
Fatal error: Uncaught exception 'SmartyException' with message 'unable to write file
shared/secured/compiler/wrt50c17dfaca2932.90478039' in
/var/www/libs/sysplugins/smarty_internal_write_file.php:44 Stack trace: #0
/var/www/libs/sysplugins/smarty_internal_template.php(201):
Smarty_Internal_Write_File::writeFile('shared/secured/...', 'compileTemplateSource() #2
/var/www/libs/sysplugins/smarty_internal_templatebase.php(374):
Smarty_Internal_TemplateBase->fetch('extends:layout....', '6666cd76f969564...', NULL,
NULL, true) #3 /var/www/classes/BaseController.php(22): Smarty_Internal_TemplateBase-
>display('extends:layout....', '6666cd76f969564...') #4
/var/www/secured/controllers/HomeController.php(6): BaseController->render('home') #5
[internal function]: HomeController->indexAction('') #6
/var/www/classes/Router.php(26): call_user_func_array(Array, Array) #7
/var/www/index.php(10): Router::run() #8 in
/var/www/libs/sysplugins/smarty_internal_write_file.php on line 44

I think it has to do with the filepath that smarty is trying to write to. In the error, the filepath is shared/secured/compiler/wrt50c17dfaca2932.90478039. It should be var/secured/compiler/wrt50c17dfaca2932.90478039

Not sure but maybe #chmod(PATH,0770); will make a trick?

Related

Deploy error with Laravel project on Shared Hosting (Uncaught RuntimeException: A facade root has not been set)

I'm deploying a laravel project into production enviroment on a shared host using FTP following this tutorial except the creation of the symbolic link beacuse I'm not using the local storage but ran into "Uncaught RuntimeException: A facade root has not been set" error.
Aditional info:
I tried with a new laravel project with the command composer create-project laravel/laravel project_name 9 and deployed without run it in my computer and got the same error, then I tested it on my computer and worked fine.
The host was configured to follow these route: /web/content, where is displayed the public files. I followed the tutorial routing and created a folder with project's name with all files except the public folder contents as showed in the tutorial but I got the error, so I thought that the structure was giving me the error so I rename the laravel public folder to content and now all files are inside in /web and still getting the error.
Server info: Linux/Apache/PHP-8
Development enviroment: Windows 10/XAMPP/PHP-8.1
For development testing I use php artisan serve rather than XAMPP
I've deployed the project in my personal Heroku and all is working fine, as an additional test, I've deployed the project via XAMPP on my computer following the same structure in the point 2 and works fine.
Checking the logs I got this:
Server Logs
[17-Jul-2022 18:40:36 America/Chicago] PHP Fatal error: Uncaught RuntimeException: A facade root has not been set. in /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:334
Stack trace:
#0 /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/RegisterErrorViewPaths.php(18): Illuminate\Support\Facades\Facade::__callStatic('replaceNamespac...', Array)
#1 /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(626): Illuminate\Foundation\Exceptions\RegisterErrorViewPaths->__invoke()
#2 /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(607): Illuminate\Foundation\Exceptions\Handler->registerErrorViewPaths()
#3 /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(538): Illuminate\Foundation\Exceptions\Handler->renderHttpException(Object(Symfony\Component\HttpKernel\Exception\HttpException))
#4 /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(444): Illuminate\Foundation\Exceptions\Handler->prepareResponse(Object(Illuminate\Http\Request), Object(Symfony\Component\HttpKernel\Exception\HttpException))
#5 /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(363): Illuminate\Foundation\Exceptions\Handler->renderExceptionResponse(Object(Illuminate\Http\Request), Object(ParseError))
#6 /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(427): Illuminate\Foundation\Exceptions\Handler->render(Object(Illuminate\Http\Request), Object(ParseError))
#7 /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(115): Illuminate\Foundation\Http\Kernel->renderException(Object(Illuminate\Http\Request), Object(ParseError))
#8 /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/content/index.php(51): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#9 {main}
thrown in /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php on line 334
Laravel Logs
[2022-07-17 18:40:36] laravel.EMERGENCY: Unable to create configured logger. Using emergency logger. {"exception":"[object] (InvalidArgumentException(code: 0): Log [] is not defined. at /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/laravel/framework/src/Illuminate/Log/LogManager.php:207)
[stacktrace]
#0 /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(132): Illuminate\\Log\\LogManager->resolve(NULL, NULL)
#1 /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(119): Illuminate\\Log\\LogManager->get(NULL)
#2 /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(636): Illuminate\\Log\\LogManager->driver()
#3 /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(275): Illuminate\\Log\\LogManager->error('syntax error, u...', Array)
#4 /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(415): Illuminate\\Foundation\\Exceptions\\Handler->report(Object(ParseError))
#5 /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(113): Illuminate\\Foundation\\Http\\Kernel->reportException(Object(ParseError))
#6 /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/content/index.php(51): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request))
#7 {main}
"}
[2022-07-17 18:40:36] laravel.ERROR: syntax error, unexpected token ")" {"exception":"[object] (ParseError(code: 0): syntax error, unexpected token \")\" at /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/symfony/finder/Finder.php:588)
[stacktrace]
#0 /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/composer/ClassLoader.php(428): Composer\\Autoload\\includeFile('/mnt/stor2-wc1-...')
#1 /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php(88): Composer\\Autoload\\ClassLoader->loadClass('Symfony\\\\Compone...')
#2 /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php(65): Illuminate\\Foundation\\Bootstrap\\LoadConfiguration->getConfigurationFiles(Object(Illuminate\\Foundation\\Application))
#3 /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php(39): Illuminate\\Foundation\\Bootstrap\\LoadConfiguration->loadConfigurationFiles(Object(Illuminate\\Foundation\\Application), Object(Illuminate\\Config\\Repository))
#4 /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(239): Illuminate\\Foundation\\Bootstrap\\LoadConfiguration->bootstrap(Object(Illuminate\\Foundation\\Application))
#5 /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(153): Illuminate\\Foundation\\Application->bootstrapWith(Array)
#6 /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(137): Illuminate\\Foundation\\Http\\Kernel->bootstrap()
#7 /mnt/stor2-wc1-dfw1/406060/2039643domain/web/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(111): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request))
#8 /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/content/index.php(51): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request))
#9 {main}
"}
UPDATE
By curiosity, tried with Laravel 8 and all work fine, but with Laravel 9 don't and by project's requirements, I'm not allowed to downgrade the Laravel version.
Well I couldn't manage to solve the problem on Laravel 9, so the solution was to downgrade to Laravel 8, maybe the problem is the configuration on the host server.

CakePHP and Memcached error - php5.6

I'm trying to migrate our company application from php 5.3 to php 5.6. This app uses cakephp 2.4.3 and memcached, but when I try to execute ./cake bake command, the next error comes up:
Fatal error: Uncaught exception 'CacheException' with message 'Cache engine _cake_core_ is not properly configured.' in /cluster/data/deploy/clickdelivery/current/lib/Cake/Cache/Cache.php:181
Stack trace:
#0 /cluster/data/deploy/clickdelivery/current/lib/Cake/Cache/Cache.php(151): Cache::_buildEngine('_cake_core_')
#1 /cluster/data/deploy/clickdelivery/current/app/Config/core.php(381): Cache::config('_cake_core_', Array)
#2 /cluster/data/deploy/clickdelivery/current/lib/Cake/Core/Configure.php(72): include('/cluster/data/d...')
#3 /cluster/data/deploy/clickdelivery/current/lib/Cake/bootstrap.php(177): Configure::bootstrap(true)
#4 /cluster/data/deploy/clickdelivery/current/lib/Cake/Console/ShellDispatcher.php(136): require('/cluster/data/d...')
#5 /cluster/data/deploy/clickdelivery/current/lib/Cake/Console/ShellDispatcher.php(98): ShellDispatcher->_bootstrap()
#6 /cluster/data/deploy/clickdelivery/current/lib/Cake/Console/ShellDispatcher.php(54): ShellDispatcher->_initEnvironment()
#7 /cluster/data/deploy/clickdelivery/cu in /cluster/data/deploy/clickdelivery/current/lib/Cake/Cache/Cache.php on line 181
Persistent and models directory are created with +W.
Thanks in advance.

How to run php unit tests in Yii 1.1

Please help. I've been at this for days.
PHPUnit version: 4.4.0
Whenever I try to run a unit test, I get this error:
PHP Fatal error: Uncaught exception 'CException' with message 'CHttpRequest is unable to determine the request URI.' in /var/www/framework/web/CHttpRequest.php:519
My bootstrap file:
// change the following paths if necessary
set_include_path(get_include_path() . PATH_SEPARATOR . '/var/www/protected/config/vendor/phpunit/phpunit-selenium');
$yiit=dirname(__FILE__).'/../../framework/yiit.php';
$config=dirname(__FILE__).'/../config/test.php';
require_once($yiit);
require_once(dirname(__FILE__).'/WebTestCase.php');
Yii::createWebApplication($config);
The error Stack trace:
#0 /vagrant/black-box/framework/web/CHttpRequest.php(431): CHttpRequest->getRequestUri()
#1 /vagrant/black-box/framework/web/CUrlManager.php(364): CHttpRequest->getPathInfo()
#2 /vagrant/black-box/protected/extensions/yii-debug-toolbar/YiiDebugToolbarRoute.php(113): CUrlManager->parseUrl(Object(CHttpRequest))
#3 /vagrant/black-box/framework/logging/CLogRouter.php(66): YiiDebugToolbarRoute->init()
#4 /vagrant/black-box/framework/base/CModule.php(387): CLogRouter->init()
#5 /vagrant/black-box/framework/base/CModule.php(523): CModule->getComponent('log')
#6 /vagrant/black-box/framework/base/CApplication.php(164): CModule->preloadComponents()
#7 /vagrant/black-box/framework/YiiBase.php(125): CApplication->__construct('/vagrant/black-...')
#8 /vagrant/black-box/framework/YiiBase.php(98): YiiBase::createApplication('CWebApplication', '/vagrant/blac in /vagrant/black-box/framework/web/CHttpRequest.php on line 519
Looks like you have configured the YiiDebugToolbarRoute in your configuration.
This is only useful in web environment and causes problems here.
Remove the configuration for logging from your application config in test ENV.

CakePHP: Could not load configuration file

I'm trying to get a cakephp project up and running from a svn checkout on my mountain lion computer.
I changed all the cache write permissions find but now I have one last fatal error that's not letting the app run.
Fatal error: Uncaught exception 'ConfigureException' with message 'Could not load configuration file: /Users/mike/cake2cribs/cake2cribs/app/Config/core-production.php' in /Users/mike/cake2cribs/cake2cribs/lib/Cake/Configure/PhpReader.php:77
Stack trace: #0
/Users/mike/cake2cribs/cake2cribs/lib/Cake/Core/Configure.php(267):
PhpReader->read('core-production') #1
/Users/mike/cake2cribs/cake2cribs/app/Config/core.php(287):
Configure::load('core-production') #2
/Users/mike/cake2cribs/cake2cribs/lib/Cake/Core/Configure.php(76):
include('/Users/mike/cak...') #3
/Users/mike/cake2cribs/cake2cribs/lib/Cake/bootstrap.php(146):
Configure::bootstrap(true) #4
/Users/mike/cake2cribs/cake2cribs/app/webroot/index.php(81):
include('/Users/mike/cak...') #5 {main} thrown in
/Users/mike/cake2cribs/cake2cribs/lib/Cake/Configure/PhpReader.php on
line 77
it fails on this line inside index.php inside webroot
if (!include ('Cake' . DS . 'bootstrap.php')) {
$failed = true;
}
Any ideas as to what could be the cause?
I've never done an Ubuntu install, I've always just downloaded the source and put it in my webroot. Anyway, cake always expects to have a file called core.php which holds all the config info. Maybe the Ubuntu install just expects core-production.php, so you might just need to copy the core.php file in app/Config and rename it to core-production.php.

cakephp upgrade shell debug kit error

I' m trying to use cakephp upgrade shell to migrate my project to cakephp 1.3 -> 2.0.1 but when i run the script, it; s returning the following error:
Error: Plugin DebugKit could not be found.
#0 /Applications/MAMP/htdocs/youppie/lib/Cake/Core/App.php(328): CakePlugin::path('DebugKit')
#1 /Applications/MAMP/htdocs/youppie/lib/Cake/Console/Command/UpgradeShell.php(223): App::pluginPath('DebugKit')
#2 /Applications/MAMP/htdocs/youppie/lib/Cake/Console/Command/UpgradeShell.php(91): UpgradeShell->helpers()
#3 /Applications/MAMP/htdocs/youppie/lib/Cake/Console/Shell.php(372): UpgradeShell->all()
#4 /Applications/MAMP/htdocs/youppie/lib/Cake/Console/ShellDispatcher.php(177): Shell->runCommand('all', Array)
#5 /Applications/MAMP/htdocs/youppie/lib/Cake/Console/ShellDispatcher.php(69): ShellDispatcher->dispatch()
#6 /Applications/MAMP/htdocs/youppie/app/Console/cake.php(41): ShellDispatcher::run(Array)
#7 {main}
I' m running ./Console/cake upgrade upgrade all --dry-run inside app directory
Anyone knows what i'm doing wrong ?
As a rule of thumb, move your plugins folder out of the app, so it is not affected during the upgrade. You could also leave the folder there, but just move the contents of it out of the scene.
Also remember that in 2.0, plugins need to be loaded manually. In your bootstrap file add CakePlugin::loadAll() or just CakePlugin::load('MyPlugin')

Categories