You are not logged in.
Hi,
My installation of Apache and PHP work fine, I did everything as written in the LAMP page on ArchWiki.
Now I wanted to use json_encode(), so I deleted the comment ";" in front of extension=json.so in my php.ini.
But after restarting httpd, it doesn't render PHP anymore. It serves me with a pop-up screen as if I wanted to download the *.php.
Howcome this strange behaviour? I hope one of you can enlighten me.
edit: obviously, in my error.logs I find a Fatal error: Call to undefined function json_encode(). But I thought it was built in, since PHP 5.2...
jocom
Last edited by jocom (2010-12-13 11:49:38)
Offline
Ok, I discovered it isn't
;extension=json.so
that caused the problem. It is because of the header I try to send.
header("Content-type: application/json; charset="utf-8");
Any idea what's wrong with that?
Offline
You have 3 doublequotes?
ᶘ ᵒᴥᵒᶅ
Offline
You have 3 doublequotes?
Actually, that was a typo...
The whole problem is, that Firefox doesn't recognize "application/json", so it works, if I totally remove the header declaration, or change it to "text/plain".
Offline