I am working on a web solution for displaying some information from some databases with yiiframework. In the background there is a Ingres DB and with an ODBC driver I am getting the needed information. For the website I am using an apache2 server (based on Linux).
The connection to the database works, but I have very long charging times but don’t know why. The ODBC driver should not be the problem, with an ISQL command I am getting the information of the database in a few seconds.
The Logs section will show you some traces, like the time it takes to open the connection to the database, perform queries, etc. This will allow you to understand exactly what’s going on, and spot the place where time is wasted (if you see a big jump in timestamp, focus on that part)
The Ingres DB and Yii are running on different server, but unfortunately that’s not to change…
Separate servers is a good thing I was asking to know the setup. In the case of separate servers, a common problem is the connection overhead.
Im am getting the message:
Cannot create cache directory /home/abntlfz/.composer/cache/repo/https—repo.packagist.org/, or directory is not writable. Proceeding without cache
Cannot create cache directory /home/abntlfz/.composer/cache/files/, or directory is not writable. Proceeding without cache
./composer.json is not writable.
Sorry, but I have some problems while installing composer.
At first, I wanted to install it via:
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
But, I don’t know why, I can’t connect to the site to download the file. So I have downloaded it manually and copied the file to the root directory, where I have “installed” it. With ./composer I see, that it works.
Now I want to use the command:
php composer.phar require --prefer-dist yiisoft/yii2-debug but I am only getting the message “Do not run composer as super user…”.
Now I don’t know, what I could do, to fix this. Sorry, but I’ve tried many things and didn’t get it fixed. Thanks in advance!
Thanks for your fast reply. Then I have the problem again with creating cache directory:
Cannot create cache directory /home/abntlfz/.composer/cache/repo/https—repo.packagist.org/, or directory is not writable. Proceeding without cache
Cannot create cache directory /home/abntlfz/.composer/cache/files/, or directory is not writable. Proceeding without cache
I have the possibility to use root or my user abn… but with root, composer don’t let me do anything as super user and with my user I have not enough rights…
Edit: Oh I think mybe it worked? My command line shows the following:
> Cannot create cache directory /home/abntlfz/.composer/cache/repo/https—repo.packagist.org/, or directory is not writable. Proceeding without cache
Cannot create cache directory /home/abntlfz/.composer/cache/files/, or directory is not writable. Proceeding without cache
Using version ^2.0 for yiisoft/yii2-debug
./composer.json has been updated
In composer.json is now:
{
“yiisoft/yii2-debug”: “~2.0.0”,
“require”: {
“yiisoft/yii2-debug”: “^2.0”
}
}
Is it enough to set “defined(‘YII_DEBUG’) or define(‘YII_DEBUG’, true);” in index.php true? If yes, then maybe it didn’t worked because by reloading the page I dont see the composer debug window (like described).
For a simple test it should be enough to set the debug var = true and insert the IP of the webpage in web.php, or? ‘allowedIPs’ => [‘190.16.200.155’, ‘::1’],
Is the part open files in IDE optional or isn’t it?
The debug section was already there. Now my web.php file contains the following:
if (YII_ENV_DEV) {
// configuration adjustments for 'dev' environment
$config['bootstrap'][] = 'debug';
$config['modules']['debug'] = [
'class' => 'yii\debug\Module',
// uncomment the following to add your IP if you are not connecting from localhost.
'allowedIPs' => ['172.16.200.155', '::1'],
];
$config['bootstrap'][] = 'gii';
$config['modules']['gii'] = [
'class' => 'yii\gii\Module',
// uncomment the following to add your IP if you are not connecting from localhost.
'allowedIPs' => ['172.16.200.155', '::1'],
];
}
Yes, my index.php contains:
// comment out the following two lines when deployed to production
defined(‘YII_DEBUG’) or define(‘YII_DEBUG’, true);
defined(‘YII_ENV’) or define(‘YII_ENV’, ‘dev’);
But I have changed it in web.php to (true) but I can’t see any debug tool. Maybe there is something wrong with the composer? Have I after running php composer.phar require --prefer-dist yiisoft/yii2-debug something else to do with the composer?
So we had a private chat, and it turns out that the debug panel is now showing, and the problem seems indeed to be that establishing the connection needs more than 4 seconds.
The reason of the slowness should be first fixed between the two servers, without regards to Yii. Then it should be way better.