Today I’m coming with a setting for Yii2, as I haven’t found any documentation about this. So we will set up advanced template of Yii, on a Directadmin server, running on nginx. First of all, you need to install Yii2 – you can do it as you like, via composer or regular installation. This step is very well… Read More »
Sometimes all you need to do is to redirect customers to another domain, with same query he had. It is easy to do with .htaccess if you have Apache, but if you have nginx, you have to ask your server administrator to do that. If you are a server administrator, here’s the trick: Log in as admin, go… Read More »
Inspired from Github If you have links, that might end with slashes (sometimes they are being added automatically), you won’t be able to handle them unless you add a string to your Yii2 project configuration. Since version 2.0.10 UrlManager can be configured to handle trailing slashes in a simple way. Just make sure your config file has normalizer… Read More »
Today just a simple command. If you need to know the current query for an Activerecord object, you need this simple command: This will show current SQL query. Another solution is:
This error appeared today when I tried to install git on a clean Debian 9.8 server: This error means you don’t have gettext installed. Fix it with the following command as root: That’s all. The error above should not appear anymore.
If you need to permanently change Apache DocumentRoot for just a single domain, you should do this as Admin. Go to http://[domain]:2222/CMD_CUSTOM_HTTPD?domain=[domain] In the first window, under Only add the few lines of the VirtualHost you need to insert. Do not add a whole .. Add the following line: |?DOCROOT=/custom/document/root| Don’t forget to put pipes at the start… Read More »
Here comes the guide for global composer installation. Rename it to composer-setup.php Use this command for global installation: All done! Now you can run composer from command line by simply typing composer.
Sometimes you need to use MySQL replication (master-slave) on the same server. Let me tell you how to set this up in 10 minutes or less. :) First of all, we need to locate MySQL configuration file, containing [mysqld] section. If you don’t know how to do that, you are welcome to see here. Next we need to… Read More »
Sometimes you need to connect to MySQL server from different locations. In this case you need to set up the server so it could accept such requests. In order to do that, you have to add a single string in your MySQL config file. First of all, we need to find the location of my.cnf file. mysql –help… Read More »
Here is a quick guide for composer setup on a DirectAdmin server (if you want to make it available for all users). We will use Directadmin Composer plugin – you can get one here First of all, we will need root access to install this plugin. Here is the list of commands for that: cd /usr/local/directadmin/plugins; wget https://github.com/Marco129/DirectAdmin-Composer/archive/master.zip;… Read More »