» What file extensions do I use for PHP?

For PHP files in Control Web Panel (CWP), the primary and recommended file extension is .php.

Here are the specific details for using PHP file extensions in CWP:

  • Standard Extension: Use .php for all your PHP scripts to ensure they are processed correctly by the web server (Apache/Nginx).
  • Older/Alternative Extensions: While .php is standard, some systems might support older extensions like .php3. However, sticking with .php is best practice for portability and security.
  • Unsupported Extension: Do not use .html for files containing PHP code, as the server will not execute the PHP within it.
  • Include Files: For files that are included in other scripts (e.g., config files, headers), you can use .inc, but it is safer to use .php to prevent the raw code from being displayed if the file is accessed directly. 

Recommendations for CWP Users: When creating or editing scripts in the CWP File Manager, always ensure the file ends in .php (e.g., index.php, functions.php).

Was this answer helpful?

Add to favorites Add to Favourites
Print Print this Article