Filesystem.php - failed to open stream - laravel

I made multiple web-applications using Laravel so this is not my first production deply. However - I've bumped into a weird issue that I can't seem to find the answer for. As with all applications I've done so far - I copy/pasted all the files to the production server, set up the .env file, edited app.php and database.php in the config folder but i keep getting this error:
ErrorException in ClassLoader.php line 412:
include(/home/xxxxx/public_html/appname/vendor/composer/../laravel/framework/src/Illuminate/Filesystem/Filesystem.php):
failed to open stream: No such file or directory
in ClassLoader.php line 412
at HandleExceptions->handleError('2', 'include(/home/xxxxx/public_html/appname/vendor/composer/../laravel/framework/src/Illuminate/Filesystem/Filesystem.php): failed to open stream: No such file or directory', '/home/xxxxx/public_html/appname/vendor/composer/ClassLoader.php', '412', array('file' => '/home/xxxxx/public_html/appname/vendor/composer/../laravel/framework/src/Illuminate/Filesystem/Filesystem.php')) in ClassLoader.php line 412
at Composer\Autoload\includeFile() in ClassLoader.php line 412
at Composer\Autoload\includeFile('/home/xxxxx/public_html/appname/vendor/composer/../laravel/framework/src/Illuminate/Filesystem/Filesystem.php') in ClassLoader.php line 301
at ClassLoader->loadClass('Illuminate\Filesystem\Filesystem')
at spl_autoload_call('Illuminate\Filesystem\Filesystem') in Application.php line 539
at Application->registerConfiguredProviders() in RegisterProviders.php line 17
at RegisterProviders->bootstrap(object(Application)) in Application.php line 203
at Application->bootstrapWith(array('Illuminate\Foundation\Bootstrap\DetectEnvironment', 'Illuminate\Foundation\Bootstrap\LoadConfiguration', 'Illuminate\Foundation\Bootstrap\ConfigureLogging', 'Illuminate\Foundation\Bootstrap\HandleExceptions', 'Illuminate\Foundation\Bootstrap\RegisterFacades', 'Illuminate\Foundation\Bootstrap\RegisterProviders', 'Illuminate\Foundation\Bootstrap\BootProviders')) in Kernel.php line 253
at Kernel->bootstrap() in Kernel.php line 144
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 116
at Kernel->handle(object(Request)) in index.php line 54
Now... I've tried everything i found on the web so far. Clearing cache, checking file permissions, running composer dump autoload, reuploading all the files - but nothing seems to help. It's a shared hosting with PHP v5.6 which already has several laravel applications running and they work perfectly. The only difference is that this one is laravel 5.3 and the other are 5.2.
I have no errors on my local dev machine.
Any ideas!?

This might happen due to some security features that are active on the web hosting itself. The mentioned class gets flagged as malware and the AV keeps deleting it upon upload/reupload. Since the whole file/class is missing - the application throws the mentioned error.
If you don't run your own server and can't white-list the file, just contact your hosting provider to do it for you.

I found the solution here https://laracasts.com/discuss/channels/laravel/filesystemphp .
It may be because of the exec function that is used in function link. Just remove this part:
/**
* Create a hard link to the target file or directory.
*
* #param string $target
* #param string $link
* #return void
*/
public function link($target, $link)
{
if (! windows_os()) {
return symlink($target, $link)
}
$mode = $this->isDirectory($target) ? 'J' : 'H';
exec("mklink /{$mode} \"{$link}\" \"{$target}\"");
}

Related

Magento Migration 1.9.2.0 to Magento 2.3.2 from CLI

I am trying to migrate website from Magento 19.2.0 to Magento 2.3.2 using CLI. I have made all changes in config.xml file with path to both database and here is the command i am trying to execute to apply settings.
php bin/magento migrate:settings --reset vendor/magento/data-migration-tool/etc/opensource-to-opensource/1.9.2.0/config.xml
would be great if someone suggest the fix for this error.
In Dom.php line 455:
AttValue: " or ' expected Line: 110
attributes construct error Line: 110
Couldn't find end of Start Tag database line 110 Line: 110
AttValue: " or ' expected Line: 113
attributes construct error Line: 113
Couldn't find end of Start Tag database line 113 Line: 113
Had a similar error, check your config.xml in line 110, I just forget a closing "
I solved this problem changing the database password.
I removed all special characters from the password and the import worked fine! There is some password field at the config.xml in my case

Getting error when deploying Laravel code

trying to deploy locally first, then to Heroku code following tutorial provided by class professor. Followed video to the T but his deploys and mine doesn't. I am code-dumb so please be as basic as possible. https://www.youtube.com/watch?time_continue=1583&v=8NOslcDSIoI
Using Laravel with PhpStorm.
Could not find resource 'views/layouts.html.php' in any resource paths.(searched: C:\Users\{MY NAME}\PhpstormProjects\is601webpage\vendor\filp\whoops\src\Whoops\Handler/../Resources)
(1/1) RuntimeException
Could not find resource 'views/layouts.html.php' in any resource paths.(searched: C:\Users\{MY NAME}\PhpstormProjects\is601webpage\vendor\filp\whoops\src\Whoops\Handler/../Resources)
in PrettyPageHandler.php line 621
at PrettyPageHandler->getResource('views/layouts.html.php')
in PrettyPageHandler.php line 170
at PrettyPageHandler->handle(object(ErrorException))
in Run.php line 320
at Run->handleException(object(ErrorException))
in Handler.php line 343
at Handler->renderExceptionWithWhoops(object(ErrorException))
in Handler.php line 322
at Handler->renderExceptionContent(object(ErrorException))
in Handler.php line 306
at Handler->convertExceptionToResponse(object(ErrorException))
in Handler.php line 285
File name should be layouts.blade.php.

joomla 3.4 transfer to other server

I have transferred Joomla 3.4 (from a cPanel backup) to Plesk. The site is 8GB.
I have changed the permissions for folders and files. I can login normally to the /administrator
At the front end I get this error message -
Notice: Use of undefined constant JPATH_BASE - assumed 'JPATH_BASE' in /var/www/vhosts/XXXXX/httpdocs/defines.php on line 12 Notice: Use of undefined constant JPATH_BASE - assumed 'JPATH_BASE' in /var/www/vhosts/XXXXX/httpdocs/defines.php on line 22 Notice: Use of undefined constant JPATH_BASE - assumed 'JPATH_BASE' in /var/www/vhosts/XXXXX/httpdocs/defines.php on line 23 Warning: require_once(/var/www/vhosts/XXXXX/httpdocs/includes/defines.php): failed to open stream: No such file or directory in /var/www/vhosts/XXXXX/httpdocs/index.php on line 31 Fatal error: require_once(): Failed opening required '/var/www/vhosts/XXXXX/httpdocs/includes/defines.php' (include_path='.:') in /var/www/vhosts/XXXXX/httpdocs/index.php on line 31
Also I have one other Joomla site to the same server, which loaded as expected without an error.
I need help in figuring out how to fix this error.
are the account constants in configuration.php file updated to a new server? additionally check your php.ini file if you have one.
It seems "defines.php" file was moved to root path.
It should be in "\includes" path.
https://github.com/joomla/joomla-cms/tree/staging/includes
Move(Crop/Paste) it into "\includes" folder.

Magento cronjob error

I'm trying to set up a cronjob for magento.
My cronjob is:
*/5 * * * * /bin/sh /var/www/vhosts/#######/httpdocs/cron.sh >/dev/null 2>&1
This works well, but cron.sh is giving this error:
PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/cli/conf.d/imap.ini on line 1 in Unknown on line 0
PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/cli/conf.d/mcrypt.ini on line 1 in Unknown on line 0
[eAccelerator] This build of "eAccelerator" was compiled for PHP version 5.3.2-1ubuntu4.9. Rebuild it for your PHP version (5.3.2-1ubuntu4.14) or download precompiled binaries.
PHP Warning: Directive 'safe_mode' is deprecated in PHP 5.3 and greater in Unknown on line 0
PHP Warning: realpath(): SAFE MODE Restriction in effect. The script whose uid is 0 is not allowed to access /var/www/vhosts/########/httpdocs/app owned by uid 10001 in /var/www/vhosts/########/httpdocs/app/Mage.php on line 273
PHP Fatal error: Uncaught exception 'Mage_Core_Exception' with message ' is not a directory or not readable by this user' in /var/www/vhosts/########/httpdocs/app/Mage.php:594
Stack trace:
#0 /var/www/vhosts/########/httpdocs/app/Mage.php(278): Mage::throwException(' is not a direc...')
#1 /var/www/vhosts/########/httpdocs/app/Mage.php(752): Mage::setRoot()
#2 /var/www/vhosts/########/httpdocs/cron.php(29): Mage::isInstalled()
#3 {main}
thrown in /var/www/vhosts/########/httpdocs/app/Mage.php on line 594
Deleted the first line of /etc/php5/cli/conf.d/mcript.ini (Number 12)
This may help you
For reference :
https://bugs.launchpad.net/ubuntu/+source/php5/+bug/573436
eaccelerator : https://wiki.archlinux.org/index.php/EAccelerator
safe_mode : just comment safe_mode or Laravel shared hosting - Directive 'safe_mode' is deprecated in PHP 5.3 and greater
app :file permission issue give -R 777

Blank pages at joomla backend,error 404,not saving changes

Blank article page.
Errors found listed below .I'm a beginner with joomla I'm lost on a project now .at First was error 404 after update to joomla 2.5.9 ,now i cant even access ,the articles.I'm getting blank pages from admin pages of the backend.Is dere a way i can copy all the articles out from the folder directory of gantry/joomla. If yes I can start building the website all over again. please help anybody Deadline for site to go live is tommorrow.,
Strict Standards: Declaration of JCacheControllerPage::store() should be compatible with JCacheController::store($data, $id, $group = NULL) in C:\xampp\htdocs\Gantry417\libraries\joomla\cache\controller\page.php on line 199
Strict Standards: Only variab,les should be assigned by reference in C:\xampp\htdocs\Gantry417\plugins\system\rokgallery\rokgallery.php on line 22
Strict Standards: Only variables should be assigned by reference in C:\xampp\htdocs\Gantry417\plugins\system\rokgallery\rokgallery.php on line 23
Warning: include_once(C:\xampp\htdocs\Gantry417/components/com_content/helpers/route.php): failed to open stream: No such file or directory in C:\xampp\htdocs\Gantry417\plugins\finder\content\content.php on line 330
Warning: include_once(): Failed opening 'C:\xampp\htdocs\Gantry417/components/com_content/helpers/route.php' for inclusion (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\Gantry417\plugins\finder\content\content.php on line 330
Fatal error: Class 'ContentHelperRoute' not found in C:\xampp\htdocs\Gantry417\plugins\finder\content\content.php on line 273
Warning: require_once(C:\xampp\htdocs\Gantry417/components/com_content/helpers/route.php): failed to open stream: No such file or directory in C:\xampp\htdocs\Gantry417\administrator\templates\hathor\html\com_content\articles\modal.php on line 17
Fatal error: require_once(): Failed opening required 'C:\xampp\htdocs\Gantry417/components/com_content/helpers/route.php' (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\Gantry417\administrator\templates\hathor\html\com_content\articles\modal.php on line 17
Check the permission to the route.php file.
Make sure the route.php file exists on the mentioned path.
The route.php file is not there / is not readable.
download the update package 2.5.9 http://joomlacode.org/gf/download/frsrelease/17967/78436/Joomla_2.5.x_to_2.5.9-Stable-Patch_Package.zip and explode it over your current site;
clear the cache/* folder
re-assign permissions (chown -R user:group *)
you should now be able to access administrator.
If you can also access the frontend, you're done.
Else assign one of the default templates (i.e. beez) and you should be able to see the website
If the latter works, then most likely you have a wrong gantry, re-download the right version of the template for your website.
If it doesn't, simply reinstall it there may be something wrong.

Resources