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 »
Sometimes, when you run out of space, you can see that there are lots of files like mysql-bin.000131 in your mysql directory (usually /var/lib/mysql). How can you delete these logs without harming your server? These are mysql binary log files. These are files that contain information about data modifications, that were made by the MySQL server. The log… Read More »
This issue is related to MySQL upgrade, when some table data was not updated to new format. When you try to run mysqldump or any other command, you can get this error. So let’s fix it, you’ll need root access or any other account with same privileges (if you are using Directadmin, this user might be da_admin). First,… Read More »