Magento migration from Godaddy server to Amazon aws Ubuntu - php

I migrated magento host server from Godaddy to amazon aws ubuntu . Everything working fine but when user proceed to checkout. An error appears on screen
Error : Warning:
include(/var/www/html/includes/src/Payu_PayuCheckout_Model_Shared.php): failed to open stream: No such file or directory in /var/www/html/includes/src/Varien_Autoload.php on line 93 #0 /var/www/html/includes/src/Varien_Autoload.php(93): mageCoreErrorHandler(2, 'include(/var/ww...', '/var/www/html/i...', 93, Array) #1 /var/www/html/includes/src/Varien_Autoload.php(93): Varien_Autoload::autoload() #2 [internal function]: Varien_Autoload->autoload('Payu_PayuChecko...') #3 [internal function]: spl_autoload_call('Payu_PayuChecko...') #4 /var/www/html/includes/src/__default.php(23435): class_exists('Payu_PayuChecko...') #5 /var/www/html/app/Mage.php(462): Mage_Core_Model_Config->getModelInstance('payucheckout/sh...', Array) #6 /var/www/html/includes/src/Mage_Payment_Helper_Data.php(68): Mage::getModel('payucheckout/sh...') ..........
but same code works fine on godaddy.
Payu module is not enabled. I tried running compilation again also.
Do I missing any Php or Apache configuration ?
Please help me. any suggestion that can resolve this error.

it might be your compilation is creating issue
Go to file
includes/config.php
comment out line
define('COMPILER_INCLUDE_PATH', dirname(__FILE__).DIRECTORY_SEPARATOR.'src');
with
#define('COMPILER_INCLUDE_PATH', dirname(__FILE__).DIRECTORY_SEPARATOR.'src');
if not commented
and remove dir includes/src

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.

Can't run composer command on remote server

Have a problem with install Symfony vendors on remote server (VPS), because after installation composer library by server administration, I have PHP Fatal error when I run it:
PHP Fatal error: Uncaught ErrorException: proc_close() has been disabled for security reasons in phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:957
Stack trace:
#0 [internal function]: Composer\Util\ErrorHandler::handle(2, 'proc_close() ha...', 'phar:///usr/loc...', 957, Array)
#1 phar:///usr/local/bin/composer/vendor/symfony/console/Application.php(957): proc_close(Resource id #252)
#2 phar:///usr/local/bin/composer/vendor/symfony/console/Application.php(753): Symfony\Component\Console\Application->getSttyColumns()
#3 phar:///usr/local/bin/composer/vendor/symfony/console/Application.php(714): Symfony\Component\Console\Application->getTerminalDimensions()
#4 phar:///usr/local/bin/composer/vendor/symfony/console/Application.php(648): Symfony\Component\Console\Application->getTerminalWidth()
#5 phar:///usr/local/bin/composer/vendor/symfony/console/Application.php(127): Symfony\Component\Console\Application->renderException(Object(ErrorException), Object(Symfony\Component\Console\Output\StreamOutput))
#6 p in phar:///usr/local/bin/composer/vendor/symfony/console/Application.php on line 957
Have PHP 7.3.15
memory_limit => 1024M
disable_functions => exec,system,passthru,shell_exec,proc_close,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname => exec,system,passthru,shell_exec,proc_close,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Maybe someone have any ideas?
If you are deploying in a shared cloud service the process won't work due to the limited resources available for your instance. I will advise you do the composer update or install on your development instance and transfer the files zipped to the host
There are multiple ways:
Contact your hosting source to allow you.
Push/Deploy the vendor from your local these way you don't need to run any composer command.

Install impresspages to localhost - problems with db connection

When i try to install impresspages on localhost in Database installation i see this:
Can't connect to database.
I try to solve this problem by installing it on hosting(its install with no problems) and then transfer it to localhost with all database, and i edit config file. And when i go to home page i saw this:
Fatal error: Uncaught exception 'Ip\Exception\Db' in C:\www\Apache2\htdocs\ip\Ip\ServiceLocator.php:258 Stack trace: #0 C:\www\Apache2\htdocs\ip\Ip\Db.php(28): Ip\Db->getConnection() #1 C:\www\Apache2\htdocs\ip\Ip\ServiceLocator.php(258): Ip\Db->__construct() #2 C:\www\Apache2\htdocs\ip\Ip\ServiceLocator.php(226): Ip\ServiceLocator::loadService('db') #3 C:\www\Apache2\htdocs\ip\Ip\Functions.php(379): Ip\ServiceLocator::db() #4 C:\www\Apache2\htdocs\ip\Ip\Internal\Plugins\Model.php(316): ipDb() #5 C:\www\Apache2\htdocs\ip\Ip\Internal\Plugins\Service.php(9): Ip\Internal\Plugins\Model::getActivePluginNames() #6 C:\www\Apache2\htdocs\ip\Ip\Dispatcher.php(140): Ip\Internal\Plugins\Service::getActivePluginNames() #7 C:\www\Apache2\htdocs\ip\Ip\Application.php(153): Ip\Dispatcher->_bindApplicationEvents() #8 C:\www\Apache2\htdocs\ip\Ip\Application.php(319): Ip\Application->_handleOnlyRequest(Object(Ip\Request), Array, false) #9 C:\www\Apache2\htdocs\ip\Ip\Application.php(413): Ip\Application->handleRequest(Object(Ip\Request), Ar in C:\www\Apache2\htdocs\ip\Ip\ServiceLocator.php on line 258
Looks like the MySQL extension for PHP is not installed or enabled. See http://php.net/manual/en/mysql.installation.php for more information.

Unable to write cache folder for smarty project on pagodabox

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?

Laravel: Permission denied in laravel Blade File

I have the following issue when trying to install Laravel http://laravel.com
Any help, would be greatly appreciated.
Unhandled Exception
Message:
file_put_contents(/Users/alvincrespo/Sites/apollo/storage/views/26bdebca7505781c753aa21663170a1b)
[function.file-put-contents]: failed to open stream: Permission denied
Location:
/Users/alvincrespo/Sites/apollo/laravel/blade.php on line 63 Stack
Trace:
#0 /Users/alvincrespo/Sites/apollo/laravel/laravel.php(40):
Laravel\Error::native(2, 'file_put_conten...', '/Users/alvincre...',
63) #1 [internal function]: Laravel{closure}(2,
'file_put_conten...', '/Users/alvincre...', 63, Array) #2
/Users/alvincrespo/Sites/apollo/laravel/blade.php(63):
file_put_contents('/Users/alvincre...', '...') #3 [internal
function]: Laravel{closure}(Object(Laravel\View)) #4
/Users/alvincrespo/Sites/apollo/laravel/event.php(199):
call_user_func_array(Object(Closure), Array) #5
/Users/alvincrespo/Sites/apollo/laravel/event.php(138):
Laravel\Event::fire('laravel.view.en...', Array, true) #6
/Users/alvincrespo/Sites/apollo/laravel/view.php(325):
Laravel\Event::until('laravel.view.en...', Array) #7
/Users/alvincrespo/Sites/apollo/laravel/view.php(546):
Laravel\View->render() #8
/Users/alvincrespo/Sites/apollo/laravel/response.php(246):
Laravel\View->__toString() #9
/Users/alvincrespo/Sites/apollo/laravel/laravel.php(138):
Laravel\Response->render() #10
/Users/alvincrespo/Sites/apollo/public/index.php(34):
require('/Users/alvincre...') #11 {main}
I would check that the permissions on:
/Users/alvincrespo/Sites/apollo/storage/views/26bdebca7505781c753aa21663170a1b
Allow your application to write to this directory.
Assuming you are on a linux box you could run ls -l to see what the permissions are, and if it is set to read only, change the permissions with chmod.
As you can see in the very good documentation under install, you have to make the directory storage/views writeable.
http://laravel.com/docs/install#installation
Although it’s an old question but I hope this might help someone, here is what solved the problem for me.
sudo chmod -R 754 storage/
check the permissions of /storage directory in the laravel installation. The views directory must have write permisison for the webserver that is it.

Categories