Laravel 5. Error "VirtualAlloc() failed: [0x00000008]" when run "composer dump-autoload" - database

I get an error "Class does not exist" when trying to populate my DB by executing
"php artisan seed:db".
UserMoviesSeeder.php in the folder database/seeds has the following content:
<?php
use Illuminate\Database\Seeder;
use App\Project;
use App\UserMovie;
use App\User;
class UserMoviesSeeder extends Seeder
{
public function run()
{
$this->call(ProjectsTableSeeder::class);
}
}
class ProjectsTableSeeder extends Seeder {
public function run()
{
DB::table('user_movies')->delete();
DB::disableQueryLog();
UserMovie::create([
'user_id' => 1734805,
'tmdb_id' => 100,
'ratio' => 4
]);
UserMovie::create([
'user_id' => 716091,
'tmdb_id' => 100,
'ratio' => 4
]);
// ... and so on
}
}
I run the command:
php artisan db:seed --class=UserMoviesSeeder
And I get an error:
In Container.php line 752:
Class UserMoviesSeeder does not exist
I tried the following:
composer dump-autoload
It returns:
VirtualAlloc() failed: [0x00000008] ������������ ������ ��� ��������� �������.
VirtualAlloc() failed: [0x00000008] ������������ ������ ��� ��������� �������.
If I rename both, the file and the class to standard name "DatabaseSeeder" and run the command:
php artisan db:seed
Then I have an error:
Out of memory (allocated 547356672) (tried to allocate 1073741824 bytes)
I assume that 547356672 is the size of my seeder file (it is about 5.5Gb).
But why it tries to allocate twice more 1073741824 ?
I have only 8Gb of RAM, so it can't allocate 10Gb.
Previously I had 10Gb seeder in this folder, but now I have just one seeder file of 5.5Gb there.

Related

Guys i am getting error as below while copying the file from puppet master to agents

1.when i used "puppet agent -t" command in agents it's not retrieving from puppet server and getting the error as below.
2.the below code i have used in modules path:/etc/puppetlabs/code/environments/production/modules/mailx/manifests/init.pp and i have included this class in site.pp file as below.
Error: 1.I
/Stage[main]/Mailx/File[/etc/mail.rc]: Could not evaluate: Could not retrieve information from environment production source(s) puppet:///modules/mailx/mail.rc
file { '/etc/mail.rc':
ensure => present,
mode => '0644',
owner => 'root',
group => 'root',
source => 'puppet:///modules/mailx/mail.rc',
}
node 'default', {
include mailx
}
Your code will be much easier to read if you present it like this.
#/etc/puppetlabs/code/environments/production/modules/init.pp
class mailx {
file { '/etc/mail.rc':
ensure => present,
mode => '0644',
owner => 'root',
group => 'root',
source => 'puppet:///modules/mailx/mail.rc',
}
}
And then the file
#/etc/puppetlabs/code/environments/production/modules/mailx/files/mail.rc
set smtp=your.smtp.server
set from="from email address"
The module should be in
/etc/puppetlabs/code/environments/production/modules/mailx/manifests/init.pp
Notice the "production" after the environments.
It may have just been a typo when you put the path in to here but you spelt puppetlabs as puppelabc.
And the file should be here
/etc/puppetlabs/code/environments/production/modules/mailx/files/mail.rc
Each directory under the environment directory is an environment and that error says Puppet is looking in the production environment for that file.

CakePhp3.3 Error: Class 'CakeHaml\View\CakeHamlView' not found

Pardon me as this is my first questions.
I tried to install a plugin for haml in cakephp 3 manually, and found this k-motoyan/cake-haml
I can't install it using composer because I use cakephp 3.3.*
k-motoyan/cake-haml dev-master requires cakephp/cakephp 3.0.*-dev ->
no matching package found.
So, I tried to install it manually, downloading the zip and put it in [app]/plugins/kmotoyan/cakephp
I follow the readme setup
Setup
Add plugin load line to config/bootstrap.php file:
diff
+ Plugin::load('CakeHaml', ['bootstrap' => true]);
Set the default ViewClass on the src/Controller/AppController.php
file:
```diff class AppController extends Controller {
public $viewClass = 'CakeHaml\View\CakeHamlView'; ```
You can use haml on all your view files with .haml extension.
and put this code below in my config/bootstrap.php
Plugin::load('kmotoyan/CakeHaml', ['bootstrap' => true]);
and this code below in my src/Controller/AppController.php
public $viewClass = 'CakeHaml\\View\\CakeHamlView';
when I load the server, i get this error
Error: Class 'CakeHaml\View\CakeHamlView' not found File
C:\xampp\htdocs\qolega\vendor\cakephp\cakephp\src\View\ViewBuilder.php
Line: 363
when I see line 363 there's this line
return new $className($request, $response, $events, $data);
what should I do?

Josegonzalez/Upload.UploadBehavior could not be found cakephp 3.x

I have a problem configuring Josegonzalez plugin, i get an error as below
Josegonzalez/Upload.UploadBehavior could not be found.
Make sure your plugin Josegonzalez/Upload is in the C:\xampp\htdocs\sunelex\plugins\ directory and was loaded.
Error: Create the class UploadBehavior below in file: C:\xampp\htdocs\sunelex\plugins\Josegonzalez/Upload\src\Model\Behavior\UploadBehavior.php
<?php
namespace Josegonzalez\Upload\Model\Behavior;
use Cake\ORM\Behavior;
class UploadBehavior extends Behavior
{
}
I managed to get the plugin via composer into the plugins folder. I then enabled the plugin in the boostrap.php like Plugin::loadAll(); My table class behavior code looks as follows.
$this->addBehavior('Josegonzalez/Upload.Upload', [
'survey_step3_asbestos_pic' => [
'fields' => [
// if these fields or their defaults exist
// the values will be set.
'dir' => 'photo_dir', // defaults to `dir`
'size' => 'photo_size', // defaults to `size`
'type' => 'photo_type', // defaults to `type`
],
],
]);
Everything is in its place but for some reason I am getting the error above. Could you please help. Thanks.
Using cmd install below command.
composer require josegonzalez/cakephp-upload
You need to enable the plugin your config/bootstrap.php file:
<?php
Plugin::load('Josegonzalez/Upload');
If you are already using Plugin::loadAll();, then this is not necessary.

DebugKit.ToolbarComponent could not be found

I followed the instruction in the README.md file in the directory DebugKit. But when I add this line I am getting this error above but when i comment out the line in the AppController then everything is ok and i'm getting "DebugKit plugin is present"
<?php
App::uses('Controller', 'Controller');
class AppController extends Controller {
public $components = array('DebugKit.Toolbar');
}
does anyone know how can i smooth this error out?
I have ubuntu 14.10 CakePHP 2.5
Make sure you have
\DebugKit
\Controller
\Component
\ToolbarComponent.php
In case you don't have this directory (which was the case for me)
then
cd Plugin/DebugKit
sudo mkdir Controller
sudo mkdir Component
sudo gedit ToolbarComponent.php
And then the text editor will pop up and just put the code below
<?php
class ToolbarComponent extends Component {
}

mongodb cakephp driver installation

I'm trying to get mongodb to work with cakephp. I'm not sure on where to place ichikaway's mongodb driver for cakephp and where to add the database connection.
My directory structure is that, under c:/websites/, I have cakephp folder and my project merry_flowers folder.
i've already gone through ichikaway's github and mark story's website.
If I put the mongodb driver in \cakephp\app\plugins and database connection in \cakephp\app\config\database.php
I'm getting the following error:
fatal error 256: ConnectionManager::loadDataSource - Unable to import DataSource class mongodb.mongodbSource [CORE\cake\libs\model\connection_manager.php, line 185]Code | Context
if (!App::import('Datasource', $class, !is_null($conn['plugin']))) {
trigger_error(sprintf(__('ConnectionManager::loadDataSource - Unable to import DataSource class %s', true), $class), E_USER_ERROR);$connName = "mongo"
$_this = ConnectionManager
ConnectionManager::$config = DATABASE_CONFIG object
ConnectionManager::$_dataSources = array
ConnectionManager::$_connectionsEnum = array
$conn = array(
"plugin" => "mongodb",
"classname" => "mongodbSource",
"parent" => array(
"filename" => "dbo_source",
"classname" => "DboSource",
"parent" => null,
"plugin" => null
),
"filename" => "dbo\mongodb_source"
)
$class = "mongodb.mongodbSource"ConnectionManager::loadDataSource() - CORE\cake\libs\model\connection_manager.php, line 185
ConnectionManager::getDataSource() - CORE\cake\libs\model\connection_manager.php, line 109
Model::setDataSource() - CORE\cake\libs\model\model.php, line 2836
Model::__construct() - CORE\cake\libs\model\model.php, line 469
ClassRegistry::init() - CORE\cake\libs\class_registry.php, line 142
Controller::loadModel() - CORE\cake\libs\controller\controller.php, line 637
Controller::constructClasses() - CORE\cake\libs\controller\controller.php, line 493
Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 186
Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 171
[main] - APP\webroot\index.php, line 87
If I put the mongodb driver in \merry_flowers\plugins and add the database connection to \merry_flowers\config\database.php, I'm getting the following error:
connecting to localhost:27017 failed: Unknown error APP\plugins\mongodb\models\datasources\mongodb_source.php, line 201
thank you.
It doesn't matter which plugins folder you use. Both have the same functionality. Both are included for your organizational convenience.
Do you have a mysql database set up also? If so, there might not be documentation for a dual installation. If you only have one DB, you should be configuring it in cakephp/app/config/database.php

Resources