How-to articles, tricks, and solutions about APACHE

Apache Files Expires / Apache Set Caches

Apache is free and open-source cross-platform web server software. Read and know about Apache Files Expires module and how to set caches with Apache.

Block direct access to a file over http but allow php script access

One way to block direct access to a file over HTTP but allow PHP script access is to use a .htaccess file in the same directory as the file.


The "net::ERR_INCOMPLETE_CHUNKED_ENCODING" error in Chrome is usually caused by a problem with the website you are trying to load.

Directory index forbidden by Options directive

This error message typically appears when you are trying to access a directory on a web server that does not contain an index.html or index.php file and the web server is configured to prevent users from browsing the directory.

enable cors in .htaccess

To enable Cross-Origin Resource Sharing (CORS) in an .htaccess file, you can add the following lines:

Enable PHP Apache2

To enable PHP for Apache2 on Ubuntu, follow these steps:

error in your SQL syntax; check the manual that corresponds to your MySQL server

This error message is indicating that there is a problem with the SQL syntax used in the query.

Execute root commands via PHP

It is generally not recommended to execute root commands via PHP, as it can pose a security risk to the system.

How do I add PHP code/file to HTML(.html) files?

To add PHP code to an HTML file, you will need to use PHP tags.

How to check the presence of php and apache on ubuntu server through ssh

To check if PHP is installed on your Ubuntu system, you can use the following command:

How to check where Apache is looking for a php.ini file?

You can check where Apache is looking for the php.ini file by running the command php --ini in the command line.

How to Redirect a Web Page with Apache

To redirect web pages in Apache you should add specific rules to a `.htaccess` on an Apache web server. Learn how to do it.

How to set for specific directory open_basedir

You can set the open_basedir configuration option in the PHP configuration file (php.ini) to specify a specific directory for the open_basedir setting.

How to use the php that brew installed?

To use the PHP that Homebrew installed, you will first need to make sure that it is in your system's PATH.

Htaccess: add/remove trailing slash from URL

To add or remove a trailing slash from the end of a URL using an .htaccess file, you can use mod_rewrite to rewrite the URL.

Location for session files in Apache/PHP

In Apache, the location for session files is determined by the session.save_path configuration directive in your php.ini file.

Only variable references should be returned by reference - Codeigniter

This error message in Codeigniter indicates that you are attempting to return a variable by reference, but only variable references can be returned by reference.

PHP Fatal error: Call to undefined function json_decode()

This error usually occurs when you are trying to use the json_decode() function, which is used to decode a JSON string into a PHP variable, but the function is not available.

Run process with realtime output in PHP

In PHP, you can use the proc_open function to run a process and read its output in real-time.

Setting up SSL on a local xampp/apache server

To set up SSL on a local XAMPP/Apache server, you will need to generate a self-signed certificate, configure the Apache server to use the certificate, and then access the server using https.

What is mod_php?

mod_php is an Apache module that allows PHP code to be executed directly by the Apache web server.

Where does PHP's error log reside in XAMPP?

In XAMPP, the error log for PHP is typically located at {xampp-install-directory}/php/logs/php_error_log.

XAMPP: Couldn't start Apache (Windows 10)

There are a few things you can try if you are having trouble starting Apache in XAMPP on Windows 10: