Yii 2 The directory does not exist on shared enviroment - web-hosting

I have problem with my web site, when i try to access it says
Fatal error: Uncaught exception
'yii\base\InvalidParamException' with message 'The directory does not exist: C:\HostingSpaces\zerguttnalog\zergutt.com'
in C:\HostingSpaces\zerguttnalog\zergutt.com\vendor\yiisoft\yii2\base\Module.php:224 Stack trace:
#0 C:\HostingSpaces\zerguttnalog\zergutt.com\vendor\yiisoft\yii2\base\Application.php(358): yii\base\Module->setBasePath('C:\\HostingSpace...')
#1 C:\HostingSpaces\zerguttnalog\zergutt.com\vendor\yiisoft\yii2\base\Application.php(223): yii\base\Application->setBasePath('C:\\HostingSpace...')
#2 C:\HostingSpaces\zerguttnalog\zergutt.com\vendor\yiisoft\yii2\base\Application.php(202): yii\base\Application->preInit(Array)
#3 C:\HostingSpaces\zerguttnalog\zergutt.com\wwwroot\index.php(12): yii\base\Application->__construct(Array)
#4 {main} thrown in C:\HostingSpaces\zerguttnalog\zergutt.com\vendor\yiisoft\yii2\base\Module.php on line 224.
On my local machine everything is ok (xampp on windows), i don't know what is happening on the server. Can anyone help?

Apparently you have set the base path of your application to (C:\HostingSpace..), it will work fine on your local machine because the directory exists, but on a different server yii will not find this directory.
Check your configuration files, you will fine a line starts with.
'basePath' => ... you need to change it to 'basePath' => dirname(__DIR__), and hopefully it will work fine.

Related

Uncaught RuntimeException on laravel 6

I am facing an error in Laravel 6. How can I solve this?
Fatal error: Uncaught RuntimeException: Directory name must not be
empty. in
D:\Xampp\htdocs\tolet\vendor\symfony\finder\Iterator\RecursiveDirectoryIterator.php:54
Stack trace: #0
D:\Xampp\htdocs\tolet\vendor\symfony\finder\Iterator\RecursiveDirectoryIterator.php(54):
RecursiveDirectoryIterator->__construct('', 4096) #1
D:\Xampp\htdocs\tolet\vendor\symfony\finder\Finder.php(669):
Symfony\Component\Finder\Iterator\RecursiveDirectoryIterator->__construct('',
4096, false) #2
D:\Xampp\htdocs\tolet\vendor\symfony\finder\Finder.php(571):
Symfony\Component\Finder\Finder->searchInDirectory('') #3
D:\Xampp\htdocs\tolet\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\LoadConfiguration.php(76):
Symfony\Component\Finder\Finder->getIterator() #4
D:\Xampp\htdocs\tolet\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\LoadConfiguration.php(59):
Illuminate\Foundation\Bootstrap\LoadConfiguration->getConfigurationFiles(Object(Illuminate\Foundation\Application))
#5 D:\Xampp\htdocs\tolet\vendor\laravel\framework\src\I in D:\Xampp\htdocs\tolet\vendor\symfony\finder\Iterator\RecursiveDirectoryIterator.php
on line 54
The error tells you that a directory name is empty. You will need to make sure that the directory name in use has a value. Check your configuration for directory names and see whether there is any of them not configured. Ask your teammates whether some new configuration items were added that they did not let you know about so far.
But most importantly, debug your code, at the very least log some values while you are working on this at the lines pointed out by the stack trace to find out what's missing. Once you know what's missing, just make sure it will not be missing at the next load.

Fatal error: Uncaught Error: Call to undefined function wp_unregister_GLOBALS() when upgrading to 5.5

I have WordPress running on Windows 10 with IIS.
While upgrading WordPress to 5.5 this morning I received the following error:
PHP Fatal error: Uncaught Error: Call to undefined function wp_unregister_GLOBALS() in C:\inetpub\wwwroot\wordpress\wp-settings.php:70 Stack trace: #0 C:\inetpub\wwwroot\wordpress\wp-config.php(92): require_once() #1 C:\inetpub\wwwroot\wordpress\wp-load.php(37): require_once('C:\inetpub\wwwr...') #2 C:\inetpub\wwwroot\wordpress\wp-admin\admin.php(34): require_once('C:\inetpub\wwwr...') #3 C:\inetpub\wwwroot\wordpress\wp-admin\index.php(10): require_once('C:\inetpub\wwwr...') #4 {main} thrown in C:\inetpub\wwwroot\wordpress\wp-settings.php on line 70
This was a very easy fix. Since my installation was local I just copied all the files and directories located in the WordPress 5.5 upgrade folder (in my case it was C:\inetpub\wwwroot\wordpress\wp-content\upgrade\wordpress-5.5-no-content-cIBdh3\wordpress) to the root of the site (in my case C:\inetpub\wwwroot\wordpress) overwriting the file already there.
Very simple fix. I guess the installation hit something while it was copying or timedout, who knows. I'm sure you can do the same thing by FTPing to your site if you are hosting your site remotely.
i am updating to 5.5 in my hostiing and i got this problem, the solution is You should upload all and folder file update except wp-content but it depends

Bugsnag error when running artisan command

I got this error when trying to run my php artisan migrate on my production server...
PHP Fatal error: Uncaught exception 'Exception' with message 'Bugsnag Error: Invalid API key' in /var/app/current/vendor/bugsnag/bugsnag/src/Bugsnag/Client.php:19
Stack trace:
#0 /var/app/current/vendor/bugsnag/bugsnag-laravel/src/Bugsnag/BugsnagLaravel/BugsnagLaravelServiceProvider.php(61): Bugsnag_Client->__construct(NULL)
#1 /var/app/current/vendor/laravel/framework/src/Illuminate/Container/Container.php(738): Bugsnag\BugsnagLaravel\BugsnagLaravelServiceProvider->Bugsnag\BugsnagLaravel\{closure}(Object(Illuminate\Foundation\Application), Array)
#2 /var/app/current/vendor/laravel/framework/src/Illuminate/Container/Container.php(631): Illuminate\Container\Container->build(Object(Closure), Array)
#3 /var/app/current/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(674): Illuminate\Container\Container->make('bugsnag', Array)
#4 /var/app/current/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(62): Illuminate\Foundation\Application->make('bugsnag', Array)
#5 /var/app/current/vendor/bugsnag/bugsna in /var/app/current/vendor/bugsnag/bugsnag/src/Bugsnag/Client.php on line 19
PHP Fatal error: Uncaught exception 'Exception' with message 'Bugsnag Error: Invalid API key' in /var/app/current/vendor/bugsnag/bugsnag/src/Bugsnag/Client.php:19
Stack trace:
#0 /var/app/current/vendor/bugsnag/bugsnag-laravel/src/Bugsnag/BugsnagLaravel/BugsnagLaravelServiceProvider.php(61): Bugsnag_Client->__construct(NULL)
#1 /var/app/current/vendor/laravel/framework/src/Illuminate/Container/Container.php(738): Bugsnag\BugsnagLaravel\BugsnagLaravelServiceProvider->Bugsnag\BugsnagLaravel\{closure}(Object(Illuminate\Foundation\Application), Array)
#2 /var/app/current/vendor/laravel/framework/src/Illuminate/Container/Container.php(631): Illuminate\Container\Container->build(Object(Closure), Array)
#3 /var/app/current/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(674): Illuminate\Container\Container->make('bugsnag', Array)
#4 /var/app/current/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(62): Illuminate\Foundation\Application->make('bugsnag', Array)
#5 /var/app/current/vendor/bugsnag/bugsna in /var/app/current/vendor/bugsnag/bugsnag/src/Bugsnag/Client.php on line 19
I ran env on the command line and I have an env variable called BUGSNAG_API_KEY and the value of it exactly matches the key at bugsnag.com for this project.
Furthermore, I have this line in my project at ./config/bugsnag.php
'api_key' => env('BUGSNAG_API_KEY'),
Weirdly, I eventually tried the same command again (php artisan migrate) and it worked! But it's left me very unsettled as it's a production server. So I'd like to understand the problem.
Errors seem to be logging in Bugsnag as well by the way.
Try to regenerate the configuration cache with php artisan config:cache. It will use the current data from the .env file to generate a new configuration cache. This worked for me.
In case this helps anyone...
The Bugsnag Git Repo mentions this issue:
(Uncaught exception 'ReflectionException' with message 'Class bugsnag.logger does not exist'
Github user GrahamCampbell suggested that what is actually happening is that another error exists, but it's "...trying to log to bugsnag which is causing this error, which is hiding the real error". I confirmed this was my issue by doing what user russianryebread suggested, which was to manually copy the bugsnag.php config file over to the Laravel /config directory. Once I did that now my real error shows:
[Symfony\Component\Debug\Exception\FatalThrowableError] Parse error: syntax error, unexpected '{'
Now to troubleshoot this issue :)
Hope this helps!

Joomla - Uncaught exception, Error 500 - less block

I've migrated a Joomla site to a new server, updated the configuration.php file, and I'm getting these errors:
Fatal error: Uncaught exception 'RuntimeException' with message 'Less Parse Error: parse error: unclosed block' in
/var/www/websites/alwaysevolving/libraries/gantry/core/gantry.class.php:1141 Stack trace: #0
/var/www/websites/alwaysevolving/templates/rt_cerulean/features/styledeclaration.php(45): Gantry->addLess('mediaqueries.le...') #1
/var/www/websites/alwaysevolving/libraries/gantry/core/gantry.class.php(415): GantryFeatureStyleDeclaration->init() #2
/var/www/websites/alwaysevolving/libraries/gantry/gantry.php(289): Gantry->initTemplate() #3
/var/www/websites/alwaysevolving/libraries/gantry/gantry.php(439): gantry_template_initialize() #4
/var/www/websites/alwaysevolving/templates/rt_cerulean/lib/gantry/gantry.php(21): include('/var/www/websit...') #5
/var/www/websites/alwaysevolving/templates/rt_cerulean/index.php(15): require_once('/var/www/websit...') #6
/var/www/websites/alwaysevolving/libraries/joomla/document/html/html.php(531): require('/var/www/websit...') #7
/var/www/websites/alwaysevolving/libraries/joomla/do in /var/www/websites/alwaysevolving/libraries/gantry/core/gantry.class.php on line 1141
It looks like there's a problem parsing one of the less files, but:
I can't tell which one of the less files has the issue
The less files were fine on the other server
The site seems fine, so it seems like something in this template doesn't like my new server.
Thoughts??
Thanks!
The error message is a stack trace, but looking at it, it appears that the Gantry framework parsing the less file called mediaqueries.less.
I strongly believe that you have forgetten to close braces }. make sure to check the line number will help you resolve the issue.

Failed opening required 'Smarty_Internal_TemplateCompilerBase.php'

I'm using smarty version 3.1.13;
My project works perfectly on the local server;
When I put my site on the server (www.1and1.com) appears the following error:
Fatal error: require_once():
Failed opening required 'Smarty_Internal_TemplateCompilerBase.php'
(include_path='/homepages/39/d441258317/htdocs/mtx/application:/
homepages/39/d441258317/htdocs/mtx/application/controllers:
/homepages/39/d441258317/htdocs/mtx/application/models:
/homepages/39/d441258317/htdocs/mtx/application/../library:
/homepages/39/d441258317/htdocs/mtx/application/../library/Smarty
/sysplugins:/homepages/39/d441258317/htdocs/mtx/application/../library
/Smarty/plugins:.:/usr/lib/php6') in /homepages/39/d441258317/htdocs/
mtx/index.php on line 28
I changed the permissions of the folder compile_c but nothing, still get an error
Appreciate your help
looks like a big problem but was not. When i created my folder in local server did i put "public" folder with "P" upercase. Because i have a linux server and linux it's case sensitive it not works. Just rename the folder from "Public" to "public" and it done!

Resources