Apache & PHP
Apache and PHP
Articles
Nginx Configuration Explained: File Locations, Server Blocks and nginx -t
Nginx reads one main file, /etc/nginx/nginx.conf, and that file includes the rest. Your website goes into its own small file with a server { } block. After every...
Options, IndexOptions, DirectoryIndex, ErrorDocument with .htaccess
These four .htaccess directives control directory listings, their style, the default index file and custom error pages.
1. Allow or block directory listing
When a URL...
PHP Compiled as? (Problems with files)
This article used to describe PHP 5 running as CGI with phpSuExec. That setup is long gone. This is how PHP runs on current Ucartz cPanel servers, and what it means...
PHP Date with Timezone: Set the Default Timezone and List All PHP Timezones
PHP’s date() uses the default timezone, which is UTC unless you set another one. Set it for one script with date_default_timezone_set('Asia/Kolkata');, or for...
PHP Warning: Cannot modify header information, headers already sent
It’s a common issue on the sites, PHP Warning: Cannot modify header information: headers already sent, Your site turn to a white page. It occurs because of...
PHP XML, DOM and XSL Extensions: Check, Install and Test XSLT
PHP handles XML through six extensions: libxml (the base library), xml (the event-based XML Parser), dom, SimpleXML, XMLReader and XMLWriter. XSLT transformations need...
PHP modules installed on the web hosting
Our PHP builds include the extensions most applications need, such as bcmath, curl, dom, exif, fileinfo, gd, gettext, iconv, intl, mbstring, mysqli, openssl, PDO...
PHP parsing of files with HTML extension
To run PHP code inside files ending in .html, tell the web server to hand those files to PHP. The old line AddType application/x-httpd-php5 .html was for PHP 5 and no...
Perl version, Path to Perl and Sendmail
If you need to find out the Current Versions and Paths to both Perl and Sendmail then simply log into your Cpanel Control Panel and look in the left-hand side column...
Permissions of the PHP files
On cPanel servers, PHP usually runs as your own cPanel user (PHP-FPM, suPHP or LSAPI). PHP files then only need to be readable and writable by you, so use these...
Raise the PHP Upload Limit with a php.ini File
You can change the upload limit for your domain yourself by adding a php.ini file in the directory where your scripts are started.for Wordpress, you have to place it...
Renaming Database Tables with phpMyAdmin
Rename a table in phpMyAdmin when an application expects a different name, for example after changing a table prefix.
Steps
Open phpMyAdmin (in cPanel: Databases ›...
Rewrite URLs with mod_rewrite and Apache
Rewrite URLs
In a block (usually found a virtual host file) or .htaccess file, enable mod_rewrite:
Apache Configuration Option
RewriteEngine on
You may create...
Rule-based Access Control for Apache
Apache provides a number of tools that allow administrators to control access to specific resources provided by servers. You may already be familiar with...
Running SQL Queries on a Database with phpMyAdmin
To run SQL queries on a database, first, log in to phpMyAdmin and then do the following:
1. Click the database on the left hand side that you wish to run the SQL...
Searching through a Database with phpMyAdmin
phpMyAdmin can search every table in a database for a word or value, which helps you find where a setting or old URL is stored.
Steps
Open phpMyAdmin (in cPanel:...
Starting html as a php file in suphp
suPHP and the PHP 5 handlers are obsolete. On current cPanel servers, the handler that runs PHP depends on your PHP version; this is how to run .html files as PHP...
Tuning Your Apache Server
Apache 2.4 performs well when configured for your traffic and memory. These settings apply to current Apache versions (the old prefork-only advice for Apache 2.2 is...
Update your Apache version in cPanel
On cPanel servers, Apache is provided by EasyApache 4 as normal system packages (ea-apache24). It is updated with the rest of the system, so there is no separate...
What Are Server Side Includes (SSI) and When to Use Them
SSI (Server Side Includes) are directives that are placed in pages and evaluated on the server while the pages are being served. They let you add dynamically generated...
What Is GoAccess(A Real-Time Apache and Nginx) And How To Use It?
GoAccess is an open-source, real-time analyser for web server logs. It reads Apache and Nginx access logs and shows visitors, requests, errors, bots, referrers and...
What Is a 302 Redirect? 302 Found vs 301, 307 and 308
302 Found is a temporary redirect: the server tells the browser that the page is, for now, at another address (given in the Location header). Browsers follow it...
What is the path to Perl
On our Linux servers, Perl is at /usr/bin/perl. Start your Perl CGI scripts with this line:
#!/usr/bin/perl
Upload scripts in ASCII (text) mode, so the line endings...
Where to put CGI files
CGI scripts (for example in Perl or Python) can run from the cgi-bin folder inside public_html, and from other folders when they use a recognised extension such as...
Why there is no package ea-apache24_mod_hostinglimits or ea-apache24_mod_lsapi available?
Since EasyApache 4 switched from compiling everything from sources (Apache itself, its modules, PHP, etc) to a RPM based setup (Apache, its modules, PHP, etc are...