Code shows instead of homepage A website I built frequently throws up the following code instead of the homepage:

&lt;?php

// Path to your craft/ folder
$craftPath = '../craft';

// Do not edit below this line
$path = rtrim($craftPath, '/').'/app/index.php';

if (!is_file($path))
{
    if (function_exists('http_response_code'))
    {
        http_response_code(503);
    }

    exit('Could not find your craft/ folder. Please ensure that &lt;strong&gt;&lt;code&gt;$craftPath&lt;/code&gt;&lt;/strong&gt; is set correctly in '.__FILE__);
}

require_once $path;


I have followed the Craft CMS install guide to the letter. Here's the output from php.ini:

engine = On
zend.ze1_compatibility_mode = Off
short_open_tag = On
asp_tags = Off
precision    =  12
y2k_compliance = On
output_buffering = Off
zlib.output_compression = Off
implicit_flush = Off
serialize_precision = 100
safe_mode = Off
disable_functions =
realpath_cache_size=256k
expose_php = Off
max_execution_time = 600     ; Maximum execution time of each script, in seconds
max_input_time = 6000   ; Maximum amount of time each script may spend parsing request data
memory_limit = 768M      ; Maximum amount of memory a script may consume (128MB)
error_reporting  =  E_ALL &amp; ~E_NOTICE
display_errors = Off
display_startup_errors = Off
log_errors = On
error_log = /var/sites/t/domain.com/public_html/error_log
log_errors_max_len = 1024
report_memleaks = On
track_errors = Off
variables_order = "EGPCS"
register_globals = Off
register_argc_argv = On
auto_globals_jit = On
upload_max_filesize = 100M
post_max_size = 100M
magic_quotes_runtime = Off
magic_quotes_gpc = Off
magic_quotes_sybase = Off
auto_prepend_file =
auto_append_file =
default_mimetype = "text/html"
extension_dir = "/usr/newage/lib/php/extensions/no-debug-non-zts-20151012"
enable_dl = Off
file_uploads = On
upload_tmp_dir = /tmp
allow_url_fopen = On
allow_url_include = Off
default_socket_timeout = 60
date.timezone = Europe/London
mysql.allow_persistent = On
mysql.max_persistent = -1
mysql.max_links = -1
mysql.default_port =
mysql.connect_timeout = 60
mysqli.max_links = -1
mysqli.default_port = 3306
mysqli.default_socket =
mysqli.default_user =
mysqli.default_pw =
mysqli.reconnect = On
[Session]
session.save_handler = files
session.save_path = /tmp
session.use_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.cookie_httponly = 
session.serialize_handler = php
session.gc_probability = 0
session.gc_divisor     = 100
session.gc_maxlifetime = 14400
session.bug_compat_42 = 1
session.bug_compat_warn = 1
session.referer_check =
session.entropy_length = 0
session.entropy_file =
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0
session.hash_function = 0

#zend_extension="/usr/newage/lib/php/extensions/no-debug-non-zts-20151012/ioncube_loader_lin_5.6.so"
#zend_extension_ts="/usr/newage/lib/php/extensions/no-debug-non-zts-20151012/ioncube_loader_lin_5.6_ts.so"
#zend_extension=/usr/newage/lib/php/extensions/no-debug-non-zts-20151012/ZendGuardLoader.so
always_populate_raw_post_data=-1


The error log set in php.ini is showing up empty.

Via the Craft CPanel, I'm seeing the following recurring errors from the logs tab:



Here's the Server info via the Craft CPanel:



My host has told me that ImageMagick isn't available on the PHP version I'm running (7.1). 

For iconv extension, the info bubble is reading:


  You have a buggy version of iconv installed. (See PHP bug #48147 and
  iconv bug #13541


My host has recently fixed load issues on one of their hosting clusters, which I initially thought might be causing the problems, but I'm still getting 503 errors.

This may be unrelated, but the site also jumps from having normal permalinks, like so: 

https://www.domain.com/pretty-page-url

To messy permalinks, like this: 

https://www.domain.com/index.php/pretty-page-url
If your website is showing the text of your index.php instead of the actual website code, something is misconfigured with your server setup. Anything .php should be passed along to php-fpm or whatever CGI handler you're using.