OSError – Errno 13 Permission denied

You need to change the directory permission so that web server process can change the directory. To change ownership of the directory, use chown:chown -R user-id:group-id /path/to/the/directory To see which user own the web server process (change httpd accordingly):ps aux | grep httpd | grep -v grep ORps -efl | grep httpd | grep -v grep

Redirect vs RedirectMatch

Redirect is supposed to redirect all URLs starting with the string. Since the URL you redirect to started with that string, naturally you instantly redirected again. RedirectMatch redirects URLs that match a regular expression. You used $ to explicitly match the end of the URL as part of that. That means that “starting with” is not enough.

PHP $_SERVER[‘HTTP_HOST’] vs. $_SERVER[‘SERVER_NAME’], am I understanding the man pages correctly?

That’s probably everyone’s first thought. But it’s a little bit more difficult. See Chris Shiflett’s article SERVER_NAME Versus HTTP_HOST. It seems that there is no silver bullet. Only when you force Apache to use the canonical name you will always get the right server name with SERVER_NAME. So you either go with that or you check the host name against a white … Read more

How to enable mod_rewrite for Apache 2.2

In order to use mod_rewrite you can type the following command in the terminal: Restart apache2 after or or as per new unified System Control Way Then, if you’d like, you can use the following .htaccess file. The above .htaccess file (if placed in your DocumentRoot) will redirect all traffic to an index.php file in the DocumentRoot unless the file exists. So, let’s say you have … Read more

Localhost is not working

If you have defined Virtual Hosts, and thats a very good idea, then you need to define the vhosts name in the HOSTS file. For example, the hosts file: Otherwise windows has no way of knowing where to look for them. Another possibility for localhost not working is a corrupted HOSTS file. Try deleting it … Read more

Chrome net::ERR_INCOMPLETE_CHUNKED_ENCODING error

OK. I’ve triple-tested this and I am 100% sure that it is being caused by my anti-virus (ESET NOD32 ANTIVIRUS 5). Whenever I disable the Real-Time protection, the issue disappears. Today, I left the Real-Time protection off for 6-7 hours and the issue never occurred. A few moments ago, I switched it back on, only for the … Read more

Whats the point of running Laravel with the command ‘php artisan serve’?

The serve command is just a shortcut for the PHP Built-in Webserver, something PHP has out of the box, so the point of using it is to start testing your application as fast as you could, you just need to install PHP, Composer and your application is up (if you don’t need anything else, of course). But if … Read more

How to run php files on my computer

You have to run a web server (e.g. Apache) and browse to your localhost, mostly likely on port 80. What you really ought to do is install an all-in-one package like XAMPP, it bundles Apache, MySQL PHP, and Perl (if you were so inclined) as well as a few other tools that work with Apache and … Read more