I have drush installed in my system but drush does not work inside vagrant. It works for MAMP though.
Here is drush status
drush status
Drupal version : 7.41
Site URI : http://default
Default theme : garland
Administration theme : garland
PHP configuration : /etc/php5/cli/php.ini
Drush version : 5.10.0
Drush configuration : /var/www/project_name/sites/all/drush/drushrc.php
Drush alias files : /home/vagrant/.drush/project_name.aliases.drushrc.php
Drupal root : /var/www/npro/docroot
Site path : sites/default
File directory path : sites/default/files
In settings.php file, mine is multi site. I added following code to sites/xyz_site/settings.php
Add following code
$databases = array(
'default' =>
array(
'default' =>
array(
'database' => 'database_name',
'username' => 'root',
'password' => 'root',
'host' => 'localhost',
'port' => '',
'driver' => 'mysql',
'prefix' => '',
),
),
);
$conf['file_public_path'] = 'sites/xyz_site/files';
Above solution worked for me.
Related
When I run php artisan:test the default connection is successful, but when I run php artisan I get an error saying the connection doesn't exist.
config/ldap.php settings:
'default' => env('LDAP_CONNECTION', 'default'),
'connections' => [
'default' => [
'hosts' => [env('LDAP_HOST', '127.0.0.1')],
'username' => env('LDAP_USERNAME', 'cn=user,dc=local,dc=com'),
'password' => env('LDAP_PASSWORD', 'secret'),
'port' => env('LDAP_PORT', 389),
'base_dn' => env('LDAP_BASE_DN', 'dc=local,dc=com'),
'timeout' => env('LDAP_TIMEOUT', 5),
'use_ssl' => env('LDAP_SSL', false),
'use_tls' => env('LDAP_TLS', false),
],
],
.env settings (username and password copied from working environment)
Laravel 9.19
PHP 8.1
directorytree/ldaprecord-laravel 2.5.6
I uninstalled and reinstalled LdapRecord with the same result.
Configuration docs:
https://ldaprecord.com/docs/laravel/v2/configuration#using-an-environment-file-env
I am using magento2 , but its page load time max than 4s.
have alread config useing varnish .
after config use redis , there are still huge sql query at catalog page ? why ? how to speed up this page ?
redis config is : app/etc/env.php
'cache' => array(
'frontend' => array(
'default' => array(
'backend' => 'Cm_Cache_Backend_Redis',
'backend_options' => array(
'server' => '127.0.0.1',
'database' => '0',
'port' => '6379',
),
),
'page_cache' => array(
'backend' => 'Cm_Cache_Backend_Redis',
'backend_options' => array(
'server' => '127.0.0.1',
'port' => '6379',
'database' => '1',
'compress_data' => '0',
),
),
),
),
=======================
catalog page query is :
enter image description here
To enable Magento2 profiler following below steps:
Set environment variable: MAGE_PROFILER = html. Refer to this link.
Enable/Set Magento2 developer mode
php bin/magento deploy:mode:set developer
Clear the cache. OR You can disable the cache for time being.
Open the website in browser incognito(private) window. Browse to the slow webpage & check at the bottom, you will see the profiler stack trace showing calls and time taken.
I am trying to upload a file from my local to FTP server using laravel
'ftp' => [
'driver' => 'ftp',
'host' => env('FTP_HOST'),
'username' => env('FTP_USERNAME'),
'password' => env('FTP_PASSWORD'),
'port' => '21',
'passive' => false,
'root' => 'c:/POSActiveAutoInsert/WEBSales_In/' // for example: /var/www/html/dev/images
//
],
In my controller
Storage::disk('ftp')->put('test.txt', $file);
But when I run this, it says
Root is invalid or does not exist: c:/POSActiveAutoInsert/WEBSales_In/
I have tried FTP using Filezilla it works fine
The FTP account I am using takes you directly to c:/POSActiveAutoInsert/WEBSales_In/ this folder. This WEBSales_In is the root folder for this FTP user that I am using. Can't figure out what the root path would be, or am I doing something wrong other than this.
Cheers
You can try this in your controller
$path = $request->your_variable_name->storeAs('text', '$file', ['disk' => 'ftp']);
I try to upload a video file to my download server with FTP file system in laravel but I have a this error:
League\Flysystem\ConnectionRuntimeException: Could not connect to host: myip, port:21 in file /home/test/domains/myhost/laravel/vendor/league/flysystem/src/Adapter/Ftp.php on line 140
in my filesytem.php
'ftp' => [
'driver' => 'ftp',
'host' => 'myip',
'username' => 'myusername',
'password' => 'mypass',
'port' => 21,
],
how to fix this error
FTP port:21 is for pass control information.
Did you try port:20 ?
im using sftp because when i using ftp is error in port too. and don't forget too enable ftp in php.ini
'sftp' => [
'driver' => 'sftp',
'host' => 'xxx.xxx.com',
'username' => 'user',
'password' => 'pass',
'root' => ' xxx' , // for example: /public_html/images
I fix this issue by enabling an FTP extension in my server.
I downloaded the DebugKit plugin using:
php composer.phar require --dev cakephp/debug_kit "~3.0"
But it still shows warning in error.log and DebugKit is not working:
Warning: DebugKit not enabled. You need to either install
pdo_sqlite, or define the "debug_kit" connection name
So how to define debug_kit connection name in app.php and how to enable debugkit??
Installing and enabling pdo_sqlite from Terminal
For PHP5.6
sudo apt-get install php5.6-sqlite3
For PHP7
sudo apt-get install php7*-sqlite3
After installation, Restart Apache Server
sudo service apache2 restart
Note: php5.6-sqlite3 = {YourPhpVersion}-{SqliteVersion}
In app file:
.../config/app.php
in option "Datasources": create new sub option like this:
'debug_kit' => [
'className' => 'Cake\Database\Connection',
'driver' => 'Cake\Database\Driver\Mysql',
'persistent' => false,
'host' => DB_HOST,
'port' => DB_PORT,
//'port' => 'non_standard_port_number',
'username' => DB_ACC,
'password' => DB_PASS,
'database' => DB_NAME,
//'encoding' => 'utf8mb4',
'timezone' => 'UTC',
'flags' => [],
'cacheMetadata' => true,
'log' => false,'quoteIdentifiers' => false,
'url' => env('DATABASE_URL', null),
]
Save file app and refresh your website. Done.