You are not logged in.
Pages: 1
Hi,
I've configured my LAMP server and tried a minimal php app from PHP and MySQL for Dummies (test.php):
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<p>This is an HTML line
<p>
<?php
echo “This is a PHP line”;
phpinfo();
?>
</body></html>
http://localhost/bimbo/test.php
Produces HTTP Error 500 (Internal Server Error). Very enlightening. It isn't probably a case of misconfiguration, as the Joomla Web Installer which lives right alongside bimbo works just fine. What then? I tried to change test.php file ownership to 501:80, like joomla/index.php, but no cigar. I tried Google, but Error 500 is obviously too broad a question. What my next step is supposed to be?
Offline
Do you get a HTTP 500 response as well if you use a plain html file (without php)?
If the issue doesn't occur then; have a look at this.
Burninate!
Offline
Logs are everything...
ᶘ ᵒᴥᵒᶅ
Offline
Look in /etc/httpd/logs/error_log and perhaps post anything relevant.
My prediction is permissions error, but that's just me trying to be psychic.
Offline
Did you set permissions to +x on the folders? You have to set executable rights on the folders as I recall. In my case it would be:
sudo chmod +x -R /media/htdocs/
Last edited by RichAustin (2012-03-11 20:36:58)
Offline
your php-code is wrong.
you used “ as quotes (ascii-code 226), instead you should use " (ascii-code 34).
heres the correct code:
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<p>This is an HTML line
<p>
<?php
echo "This is a PHP line";
phpinfo();
?>
</body></html>
systemd is like pacman. enjoys eating up stuff.
Offline
Right you are, yaffare. Thanks! That's a consequence of copy-pasting from a pdf file. Not for the first time, too... A couple of questions:
(1) Is /etc/httpd/logs/error_log the only source for php syntax errors? More generally, what are preferred php debug instruments?
(2) Is 501:80 file ownersip a security requirement?
Offline
More generally, what are preferred php debug instruments?
Any text editor with code highlighting would be good.
Or an integrated development environment (IDE) like:
Eclipse (with PHP plugin, or Eclipse PDT)
or my weapon of choice: Netbeans
Peter Martin - Joomla Open Source CMS specialist www.db8.nl
OS: Arch Linux | Arch Linux ARM | Debian | Ubuntu
Toys;-) Raspberry Pi | SheevaPlug | PogoPlug
Offline
I have heard too many complaints about Eclipse not running so great within a linux environment recently. I haven't used it in quite a bit, so I am just spreading possible rumors. If you don't have a horse in the race, then you are better off trying netbeans or any php enabled editor. I believe Geany, Bluefish, Scite (jEdit too) - I think have php support. These give you syntax coloring and some with plugins will also give you code completion. These editors will be much lighter than any IDE like Eclipse or Netbeans. - with maybe a few less features. But I find syntax coloring, code completion and code traversing as the only 3 important features (in that order) while coding.
I on the other hand am trying to learn php along with vim, which also provides syntax coloring, code completion etc with plugins -- but vim is a language on its own
There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !
Offline
I believe Geany, Bluefish, Scite (jEdit too) - I think have php support. These give you syntax coloring and some with plugins will also give you code completion. These editors will be much lighter than any IDE like Eclipse or Netbeans. - with maybe a few less features.
Yeah, I forgot to mention that using an IDE for such small pieces of code is a bit of overkill.
And Eclipse & Netbeans both need Java.
I would recommend using an IDE when you are working on bigger projects (use > 1 file) and especially if you are coding in PHP with OOP.
e.g. Netbeans Navigator = overview of classes / functions in the file you are working on = very handy...
Peter Martin - Joomla Open Source CMS specialist www.db8.nl
OS: Arch Linux | Arch Linux ARM | Debian | Ubuntu
Toys;-) Raspberry Pi | SheevaPlug | PogoPlug
Offline
Last edited by Mr.Elendig (2012-06-14 22:26:13)
Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
Offline
Pages: 1