user54600
user54600

Reputation: 268

PHP not recognized by server

I have been looking at this issue for a few hours. I looked at many Stackoverflow posts, and I couldn't find the solution to my problem.

I scrapped my website a few months ago, and just started a new one shortly thereafter. However, my website does not seem to accept PHP. I don't know if the issue is with the server (when I renewed my hosting), or something else. Even calling an external PHP file, using the include function, does not work.

Anyhow, after placing the following code (along other simple coding), I see this in my PHP file when I browse the source code - meaning PHP is not working:

<?php phpinfo() ; ?>

Also, my htaccess file says the following (but I honestly have no clue what any of it means. Though I always hear people say that this file can make a difference:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

Upvotes: 0

Views: 159

Answers (1)

Ceesiebo
Ceesiebo

Reputation: 96

It is a bit hard to understand what the actual cause is. Do you run your own webserver? If so, is it apache httpd or IIS? If you have an external hosting partner, they should be able to help you.

Why do you have a htaccess file? You only need it for things like redirect rules. If you don't use that, delete this file or empty it.

Installation of LAMP stacks :https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-16-04

Upvotes: 2

Related Questions