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 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 »