I'm trying to use yiic shell and yiic migrate tools on my iMac but I seem to be running in to some difficulties. I think it may be because I am using AMPPS as my development server instead of having installed Apache/PHP/MySQL separately. For example, in my project I have a model named Project that corresponds to a table in my MySQL database named tbl_project. I can invoke the yiic shell using :
./yiic shell /Applications/AMPPS/www/TrackStar/protected/config/main.php
However, when I run:
var_dump(Project::model()->findAll('id = 1'));
I get this lengthy error message:
Warning: PDO::__construct(): [2002] No such file or directory (trying to connect via unix:///var/mysql/mysql.sock) in /Applications/AMPPS/YiiRoot/framework/db/CDbConnection.php on line 423
exception 'CDbException' with message 'CDbConnection failed to open the DB connection: SQLSTATE[HY000] [2002] No such file or directory' in /Applications/AMPPS/YiiRoot/framework/db/CDbConnection.php:381
Stack trace:
#0 /Applications/AMPPS/YiiRoot/framework/db/CDbConnection.php(330): CDbConnection->open()
#1 /Applications/AMPPS/YiiRoot/framework/db/CDbConnection.php(308): CDbConnection-> setActive(true)
#2 /Applications/AMPPS/YiiRoot/framework/base/CModule.php(387): CDbConnection->init()
#3 /Applications/AMPPS/YiiRoot/framework/base/CModule.php(103): CModule->getComponent('db')
#4 /Applications/AMPPS/YiiRoot/framework/cli/commands/ShellCommand.php(131) : eval()'d code(1): CModule->__get('db')
#5 /Applications/AMPPS/YiiRoot/framework/cli/commands/ShellCommand.php(131): eval()
#6 /Applications/AMPPS/YiiRoot/framework/cli/commands/ShellCommand.php(99): ShellCommand->runShell()
#7 /Applications/AMPPS/YiiRoot/framework/console/CConsoleCommandRunner.php(67): ShellCommand->run(Array)
#8 /Applications/AMPPS/YiiRoot/framework/console/CConsoleApplication.php(91): CConsoleCommandRunner->run(Array)
#9 /Applications/AMPPS/YiiRoot/framework/base/CApplication.php(169): CConsoleApplication->processRequest()
#10 /Applications/AMPPS/YiiRoot/framework/yiic.php(33): CApplication->run()
#11 /Applications/AMPPS/www/TrackStar/protected/yiic.php(7): require_once('/Applications/A...')
#12 /Applications/AMPPS/www/TrackStar/protected/yiic(4): require_once('/Applications/A...')
#13 {main}
I think it is perhaps because it is trying to connect via
unix:///var/mysql/mysql.sock
which isn't where my MySQL shell resides. I have configured my config/main.php and config/console.php to reflect:
'db'=>array(
'connectionString' => 'mysql:host=localhost;dbname=trackstar',
'emulatePrepare' => true,
'username' => 'root',
'password' => 'mysql',
'charset' => 'utf8',
),
Can anyone help? I have the same problem when I try to use the migrations feature.
I think you should define the correct path to the socket
connectionString=>msql:host=localhost;dbname=trackstar;unix_socket=socket/path',
Related
Need some help. I'm new to MySQL, and whenever I enter phpmyadmin, i get this.
Notice: include(): Read of 5393 bytes failed with errno=9 Bad file descriptor in C:\xampp\phpMyAdmin\vendor\composer\ClassLoader.php on line 571
Warning: include(): Failed opening 'C:\xampp\phpMyAdmin\vendor\composer/../slim/psr7/src/Cookies.php' for inclusion (include_path='C:\xampp\php\PEAR') in C:\xampp\phpMyAdmin\vendor\composer\ClassLoader.php on line 571
Fatal error: Uncaught Error: Class "Slim\Psr7\Cookies" not found in C:\xampp\phpMyAdmin\vendor\slim\psr7\src\Factory\ServerRequestFactory.php:99 Stack trace: #0 C:\xampp\phpMyAdmin\libraries\classes\Http\Factory\ServerRequestFactory.php(41): Slim\Psr7\Factory\ServerRequestFactory::createFromGlobals() #1 C:\xampp\phpMyAdmin\libraries\classes\Common.php(84): PhpMyAdmin\Http\Factory\ServerRequestFactory::createFromGlobals() #2 C:\xampp\phpMyAdmin\index.php(40): PhpMyAdmin\Common::run() #3 {main} thrown in C:\xampp\phpMyAdmin\vendor\slim\psr7\src\Factory\ServerRequestFactory.php on line 99
This has been driving me nuts for quite a while now. And I'm about to pass the deadline for my school activity.
I've been looking through the internet for a solution to this, but found none.
PHP Version:
8.1
Shopware Version:
6.4.13
Expected behaviour:
Data migrated successfully and visible in the backend/frontend.
Actual behaviour:
Migrated data doesn't appear to visible in backend/frontend and there are errors within the logs.
How to reproduce:
I am trying to migrate from shopware 5.7 with demo-data to shopware 6.4 in my local development environment within a virtual environment.
I had followed all instructions mentioned in the site
https://docs.shopware.com/en/migration-en/Migrationprocess?category=migration-en/shopware5
I had used local gateway setup for this.
Although the status of migration is 'success'. No migrated data is visible in backend of shopware 6.4 and there are errors within the logs in migration process. I have attached a log for reference.
Error Log:
[error] SWAG_MIGRATION_RUN_EXCEPTION
An exception occurred
Entity: language, sourceId: -
SwagMigrationAssistant\Migration\Logging\Log\ExceptionRunLog::__construct(): Argument #4 ($sourceId) must be of type ?string, int given, called in /var/www/webdev/shopware56/custom/plugins/SwagMigrationAssistant/Migration/Service/MigrationDataConverter.php on line 144
[error] SWAG_MIGRATION_RUN_EXCEPTION
An exception occurred
Entity: category, sourceId: -
SwagMigrationAssistant\Profile\Shopware\Converter\ShopwareConverter::getSourceIdentifier(): Return value must be of type string, int returned
[error] SWAG_MIGRATION_RUN_EXCEPTION
An exception occurred
Entity: customer_group, sourceId: -
SwagMigrationAssistant\Profile\Shopware\Converter\ShopwareConverter::getSourceIdentifier(): Return value must be of type string, int returned
[error] SWAG_MIGRATION_RUN_EXCEPTION
An exception occurred
Entity: sales_channel, sourceId: -
SwagMigrationAssistant\Profile\Shopware\Converter\ShopwareConverter::getSourceIdentifier(): Return value must be of type string, int returned
The cause of your problem is the use of PHP 8.1 on the Shopware 5 system.
Since PHP 8.1, the data for a SELECT is no longer returned as PHP strings by default, but now has correct data types such as integer or float. See https://www.php.net/manual/de/migration81.incompatible.php#migration81.incompatible.pdo
As a workaround, you could downgrade to PHP 8.0 or add the following to your config.php in Shopware 5:
...
'db' => [
'username' => '<your-credentials>',
'password' => '<your-credentials>',
'dbname' => '<your-db-name>',
'host' => '<your-host>',
'driverOptions' => [
\PDO::ATTR_STRINGIFY_FETCHES => true,
],
],
...
With Shopware 5.7.15 this will be the default setting.
If the direct local database connection is used, you can try to add the driverOptions parameter here:
https://github.com/shopware/SwagMigrationAssistant/blob/4.2.5/Profile/Shopware/Gateway/Connection/ConnectionFactory.php#L55-L62
When I run flutter doctor command in flutter console I'm getting this error. Can someone please help me out. I tried running in C drive used both the combination of Run as Admin (C and D drive)
D:\flutter>flutter doctor
CreateProcessW failed 193
CreateProcessW failed 193
Unhandled exception:
ProcessException: %1 is not a valid Win32 application.
Command: C:\Program Files\Git\cmd\git.EXE rev-parse --abbrev-ref --symbolic #{u}
#0 _ProcessImpl._runAndWait (dart:io-patch/process_patch.dart:485)
#1 _runNonInteractiveProcessSync (dart:io-patch/process_patch.dart:631)
#2 Process.runSync (dart:io-patch/process_patch.dart:66)
#3 LocalProcessManager.runSync (package:process/src/interface/local_process_manager.dart:83)
#4 _runWithLoggingSync (package:flutter_tools/src/base/process.dart:321)
#5 runSync (package:flutter_tools/src/base/process.dart:296)
#6 _runGit (package:flutter_tools/src/version.dart:449)
#7 new FlutterVersion (package:flutter_tools/src/version.dart:23)
#8 runInContext.<anonymous closure> (package:flutter_tools/src/context_runner.dart:64)
#9 AppContext._generateIfNecessary.<anonymous closure> (package:flutter_tools/src/base/context.dart:99)
#10 _HashVMBase&MapMixin&&_LinkedHashMapMixin.putIfAbsent (dart:collection-patch/dart:collection/compact_hash.dart:277)
#11 AppContext._generateIfNecessary (package:flutter_tools/src/base/context.dart:87)
#12 AppContext.[] (package:flutter_tools/src/base/context.dart:114)
#13 FlutterVersion.instance (package:flutter_tools/src/version.dart:170)
#14 new Usage (package:flutter_tools/src/usage.dart:26)
#15 runInContext.<anonymous closure> (package:flutter_tools/src/context_runner.dart:76)
#16 AppContext._generateIfNecessary.<anonymous closure> (package:flutter_tools/src/base/context.dart:99)
#17 _HashVMBase&MapMixin&&_LinkedHashMapMixin.putIfAbsent (dart:collection-patch/dart:collection/compact_hash.dart:277)
#18 AppContext._generateIfNecessary (package:flutter_tools/src/base/context.dart:87)
#19 AppContext.[] (package:flutter_tools/src/base/context.dart:114)
#20 Usage.instance (package:flutter_tools/src/usage.dart:52)
#21 flutterUsage (package:flutter_tools/src/usage.dart:20)
#22 _handleToolError (package:flutter_tools/runner.dart:113)
<asynchronous suspension>
#23 run.<anonymous closure> (package:flutter_tools/runner.dart:63)
<asynchronous suspension>
#24 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:142)
<asynchronous suspension>
#25 _rootRun (dart:async/zone.dart:1126)
#26 _CustomZone.run (dart:async/zone.dart:1023)
#27 runZoned (dart:async/zone.dart:1501)
#28 AppContext.run (package:flutter_tools/src/base/context.dart:141)
<asynchronous suspension>
#29 runInContext (package:flutter_tools/src/context_runner.dart:43)
<asynchronous suspension>
#30 run (package:flutter_tools/runner.dart:50)
#31 main (package:flutter_tools/executable.dart:49)
<asynchronous suspension>
#32 main (file:///E:/b/build/slave/Windows_Flutter_Packaging/build/archive/flutter/packages/flutter_tools/bin/flutter_tools.dart:8)
#33 _startIsolate.<anonymous closure> (dart:isolate-patch/dart:isolate/isolate_patch.dart:277)
#34 _RawReceivePortImpl._handleMessage (dart:isolate-patch/dart:isolate/isolate_patch.dart:165)
Try to reinstall git, after that update your path to be able to run flutter from your command prompt.
for more details on how to update your path visit: Update your path
There might be a spacing issue (eg. C:\Users\M Junaid) though flutter now supports spaces but try to move ANDROID SDK into Custom location where there are no spaces (eg. C:\Users\M.Junaid) in location path and update the variable ANDROID_HOME (value should be the same location you had moved it with no spaces).
Go through this tutorial instead. I know it's a pain to watch it entirely but on the other hand you will be able to run a fresh and clean project from scratch.
Flutter tutorial
After that I ended up buying the full course and let me tell you I have not being disappointed.
I was just upgrading my prestashop store to 1.6.1.5, everything goes fine but when I was installing a module I get this error:
Fatal error: Uncaught exception 'Adapter_Exception' with message
'Service container is not set.' in
/customers/8/c/0/tinplate-models.be/httpd.www/Adapter/Adapter_ServiceLocator.php:49
Stack trace: #0
/customers/8/c/0/tinplate-models.be/httpd.www/classes/ObjectModel.php(232):
Adapter_ServiceLocator::get('Adapter_EntityM...') #1
/customers/8/c/0/tinplate-models.be/httpd.www/classes/shop/Shop.php(131):
ObjectModelCore->__construct('1', NULL, NULL) #2
/customers/8/c/0/tinplate-models.be/httpd.www/classes/shop/Shop.php(400):
ShopCore->__construct('1') #3
/customers/8/c/0/tinplate-models.be/httpd.www/config/config.inc.php(95):
ShopCore::initialize() #4
/customers/8/c/0/tinplate-models.be/httpd.www/index.php(27):
require('/customers/8/c/...') #5 {main} thrown in
/customers/8/c/0/tinplate-models.be/httpd.www/Adapter/Adapter_ServiceLocator.php
on line 49
Hope someone has a solution?
I had the same problem.
Now I found the reason - the method of Adapter_ServiceLocator.php get() using private field $service_container, which should be intalized with method setServiceContainerInstance(). I found the initializing in /config/bootstrap.php. But it wasnt any includes of the file bootstrap.php!
So you should download fresh version of Prestashop and rewrite the /config/config.inc.php.
Because it must contain
require_once $currentDir . DIRECTORY_SEPARATOR . 'bootstrap.php';
I hope it will help
I am getting a error when i run this rabbitmqserver.php file.
i googled and i couldn't find the answer.
I have all the libraries installed and i added the extension=amqp.so in the php5/cli file.
the error reads as:
PHP Fatal error: Failed to start request processor: exception 'AMQPConnectionException' with message 'Library error: a socket error occurred - Potential login failure.' in /home/ozzy/git/rabbitmqphp_example/rabbitMQLib.inc:110
Stack trace:
#0 /home/ozzy/git/rabbitmqphp_example/rabbitMQLib.inc(110): AMQPConnection->connect()
#1 /home/ozzy/git/rabbitmqphp_example/testRabbitMQServer.php(35): rabbitMQServer->process_requests('requestProcesso...')
#2 {main} in /home/ozzy/git/rabbitmqphp_example/rabbitMQLib.inc on line 132
I went to localhost:15672 and add a user called test along with a password. then i went inside Virtual host and added a virtual host and it worked.