Home to Disable PHP Safe Mode and open_basedir in Directadmin

Sometimes you need to remove limits that are automatically added by DirectAdmin. For example, you are not allowed to include files from anywhere but your home directory, you cannot use CURLOPT_FOLLOWLOCATION in php and so on. The first case is the result of open_basedir protection. If you’re not running a hosting service and all sites are yours, it… Read More »

How To Repair And Optimize All Mysql Databases

When I tried to create admin backup for DirectAdmin, I got the message that one of my MySQL databases has errors and these errors were propagated to my backup. I’d suggest this to DirectAdmin developers, as using a simple command should avoid such errors. There is a linux shell tool called mysqlcheck, that allows to check, repair and… Read More »

How to Add RAR support to CentOS 4 (Red Hat Enterprise)

Today I had to install rar support to unpack a big file. I’ve tried to download an archive from rarlab site and even unpacked it. Everything seemed to be nice, but when I tried to unpack a file, I faced the following error: unrar: /lib/tls/libc.so.6: version `GLIBC_2.4′ not found (required by unrar) . I’ve searched for an updated… Read More »

How to Disable Web Access to Account With IP and Username in Directadmin

Sometimes it is necessary to disable http://ip/~username account access for any reason. Site can be unavailable or simply you don’t want users to access it in such a way. There is a simple directive in httpd.conf that will stop it. Just find the following lines and make them the same as below: <IfModule mod_userdir.c> #UserDir public_html UserDir disabled… Read More »

Finding Difference Between Two Files with PHP

Today I will show you a short and effective solution to “minus” one file from another. The first solution uses PHP’s array_diff function and is useful when your files are not too big as this method consumes server RAM if you create big arrays. Here is the code: <? $file1=file(“plus.txt”); $file2=file(“minus.txt”); $hopa=array_diff($file1, $file2); ?> $hopa is the array… Read More »

How to Find Your php.ini file location

Often you need to make changes to your php.ini file. If you run locate php.ini, you will find some files, but this search won’t guide you to the correct one. You need one php.ini file that is used by current server configuration. Only changes that are applied there will be propagated to your php configuration. But how to… Read More »