Some 10 years ago I have been programming with php within web pages, and there was never any problem. Now, trying it again, I do encounter a problem. Php does not work. The simple function
<?php
echo “Hallo World”;
?>
Does not work – nothing appears in a browser. In the blueFish editor, the first line appears underlined red, an indication that the statement is not recognized by Appache.
The following packages are installed and activated:
apache2 version 2.4.23-31-1
apache2-mod_php7 version 7.0.7-52.1
php7 version 7.0.7-52.1
OS is SUSElinux version 42.3
all software has been downloaded from the official openSUSE repositories.
Is there anything else missing, or do I have to do something about the configuration settings?
I did not find any clue on the intelligent web pages.
That is strange, because when you try to load a page that is in fact a PHP script from Apache in a browser and Apache, for some reason, does not run the PHP script, the browser should show the text of the script and not a blank page.
> Some 10 years ago I have been programming with php within web pages, and
> there was never any problem. Now, trying it again, I do encounter a
> problem. Php does not work. The simple function
>
>
> <?php echo “Hallo World”;
> ?>
>
>
> Does not work – nothing appears in a browser. In the blueFish editor,
> the first line appears underlined red, an indication that the statement
> is not recognized by Appache.
>
>
> The following packages are installed and activated:
> apache2 version 2.4.23-31-1 apache2-mod_php7 version
7.0.7-52.1 php7
> version 7.0.7-52.1 OS is SUSElinux version 42.3 all software has been
> downloaded from the official openSUSE repositories.
>
>
> Is there anything else missing, or do I have to do something about the
> configuration settings?
> I did not find any clue on the intelligent web pages.
>
>
> Any help would be highly appreciated.
> Thank you.
What do you see if you view the page source when you browse to it?
I ask because the text you’re displaying isn’t HTML, and it may be that
the browser isn’t rendering it because it’s raw text (though it shouldn’t do that, it may well be)
…
I noticed the funny quotes in your snippet. After quickly creating a php-file and copying/pasting your snippet, I got an empty page in my browser as well.
This was in my /var/log/apache/error_log:
[Mon Jan 21 22:49:54.871080 2019] [php7:emerg] [pid 6196] [client 127.0.0.1:54472] PHP Parse error: syntax error, unexpected ‘World\xe2\x80\x9d’ (T_STRING), expecting ‘,’ or ‘;’ in /home/leen/public_html/hallo.php on line 2
Did you get something similar in your error_log?
Does your php-file load correctly after you replace both the “ (U+201C) and the ” (U+201D) with " (U+0022)? (Mine did).