How To Protect a Folder Using .htaccess From Command Line

We do often meet password protected directories on the Web. This is usually used to hide some information that should not be visible to all site users. Most common is .htaccess protection, that allows you to restrict users at Apache level and is also knows as http authentification. Today I will tell you how to protect your directory… Read More »

How to Install Zip Functions Support For PHP

Using zip files is a common practice for web. Zip archives are very useful as they are supported by all major operating systems and don’t require any special software. XP and Vista have the embedded support of this file format, you won’t also have problems opening these files in Linux. You can also work with these files in… Read More »

Apache Stopped Working After PHP Upgrade – How to Fix

If you are often working with PHP upgrades, you should do this automatically – you already know all the issues you might face. But if it’s done for the first time, it is quite hard to find your problem. I will tell you about the most common issue and about the applicable actions to fix this. When you… Read More »

How to Modify Default Virtualhost Template in Directadmin

If you own a Direactadmin server, most probably you would like to add something to default virtualhost settings, when a new user is created. You might need any specific php settings, or anything related to Apache – this doesn’t really matter. Let’s see where we can modify these settings; you will need SSH access to your server as… Read More »

Function to Extract The Value From a String With PHP

If you’re working with text information, you often need to extract some parts of text from articles, web pages and so on. You can use regular expressions for this, but if you’re not familiar with them, you’ve got to use string functions of PHP. When I didn’t know what regular expressions are, I’ve written a function that extracts… Read More »

How to Change Owner for All Files in a Folder Linux

A system administrator often needs to deal with file ownership change. This is often related to the ownership of the files created by daemons. Often users don’t have access to the file created by apache. What to do if you need to change ownership of a group of files? You must be root to perform this operation. The… Read More »

How to Create All Possible Word Combinations from a String With PHP

Sometimes you need to change the word order in a line for some reason. I am going to show you a PHP solution that allows you to create all possible word combinations from a string. The code below should explain you all operations that are performed. <? // Factorial function fact($s){ if ($s==0) return 1; else return $fact… Read More »