I’m new to this forum and new in Linux.
I have a virtual machine with OpenSuse 11.2 on it. I’m trying to create a webhost with apache2 and PHP5.
The apache is running and works OK, but I can’t get PHP to work.
When I browse to a php-file on my “server” it shows a blank page, and when I view the source of that page I can read the php-code I wrote. So I’m thinking that PHP does not compile or executes these pages…
I already tried several manuals/tutorials on how to install Apache+php, but none seem to work. The last time I also tried to set up the “HTTP-SERVER” via YAST, but it gives me the same result, HTML files are working, but PHP files give me a blank page with the php code in the source…
Anyone who can help me?
Or who has a proper tutorial on how to install apache + php (in a very simple way)
Start the software installer, select the Pattern View, tick the pattern “Web and LAMP Server”. This will pull in all packages for your LAMP (Linux Apache MySQL PHP). Create a file “index.php” containing
<?php
echo "PHP working NOW !!";
?>
Create a folder “test” in the root folder of your site (on openSUSE /srv/www/htdocs), and copy the “index.php” in it. Now browse to http://yourdomainname_or_ip/test and you should see PPH working NOW !!
Thanks for the quick reply.
I’ve set up a clean installation. I started YAST and did everything you described.
After installation I’ve created an index.php file in a subdir (test).
Unfortunately it is not working I’m having a “page cannot be displayed”, also the regular index.html is not showing. Do i need to start some services or something?
ok, it is working now, I’ve disabled the firewall.
But Still, 1 more question.
The PHP-engine only compiles when the script starts with “<?php”, is there a way to also have “<?” recognized?
You can configure PHP to accept “short-open tags” but it doesn’t really
benefit you at all and it is not the default for anything anymore. It
would be better to just search/replace through your code and use <?php ?>
instead since it is always going to work.
Good luck.
deefeketje wrote:
> ok, it is working now, I’ve disabled the firewall.
> But Still, 1 more question.
> The PHP-engine only compiles when the script starts with “<?php”, is
> there a way to also have “<?” recognized?
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/