TeddyIP
Posts: 22
Joined: Fri Jul 20, 2018 9:47 am

PHP Compilation failed.

Sun Aug 26, 2018 6:25 am

I have been googling today to try and find an answer to why I would get this message. What I am I doing wrong here?

Code: Select all

 php -l "phpTest.php" (in directory: /home/pi)
/bin/sh: 1: php: not found
Compilation failed.
Here is the code template I am trying to use.

Code: Select all

  
<?php
echo ('Hello')

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<title>untitled</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<meta name="generator" content="Geany 1.29" />
</head>

<body>

</body>

</html>

User avatar
DougieLawson
Posts: 39304
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: PHP Compilation failed.

Sun Aug 26, 2018 7:50 am

sudo apt install libapache2-mod-php7.1
sudo a2enmod php7.1
sudo systemctl restart apache2.service
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

TeddyIP
Posts: 22
Joined: Fri Jul 20, 2018 9:47 am

Re: PHP Compilation failed.

Sun Aug 26, 2018 10:56 am

Code: Select all

 pi@raspberry:~ $ sudo apt install libapache2-mod-php7.1
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package libapache2-mod-php7.1
E: Couldn't find any package by glob 'libapache2-mod-php7.1'
E: Couldn't find any package by regex 'libapache2-mod-php7.1'
pi@raspberry:~ $ 

User avatar
DougieLawson
Posts: 39304
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: PHP Compilation failed.

Sun Aug 26, 2018 10:59 am

What OS are you running?

Try sudo apt install libapache2-mod-php7.0
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

TeddyIP
Posts: 22
Joined: Fri Jul 20, 2018 9:47 am

Re: PHP Compilation failed.

Sun Aug 26, 2018 11:30 am

Thank you, DougieLawso,
That worked.

Return to “Beginners”