php are not reconighd by the browser

Hi,

I have some php files, and when I click on one of these, a window appears: " There is no specialized application for files of the type PHP script (application/x-php).
The file can be opened in a more generic application as file type plain text document (text/plain), or you can try to install a specialized application for file type PHP script (application/x-php).
Do you want to try to install a specialized application?"

And the only options to open the files are in text editors instead of browsers.

Also, If I enter the browser and open one php from there doesn’t work,

any clue ?

thanks in advance

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Opening files directly isn’t something you should usually be doing;
typically you go to a web server and then that service has the
responsibility of running the PHP script and returning output. If you
try to open a PHP script with a browser directly you will get a script
like any other displayed, at best; similar things would happen if you
opened a shell, Perl, or Python script. It’s possible to run PHP
scripts without a browser, but that’s not the same as opening them with
a browser still… it’s running them like any other script at the
command line.

Maybe taking a step back and asking why you’re trying to open them
directly with a browser is in order. If it’s “Because I think by doing
so they will run.” then you’re doing it wrong. Have a web service (like
Apache httpd) work with them and then point your browser (like you
should with a browser) to that web service.

Good luck.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iQIcBAEBAgAGBQJQmdS0AAoJEF+XTK08PnB5pzAP/0tddvlzhZqz3ZM3dXbOqXpQ
ZaHzaO1vucXOzQPi2aY0m8mkdaPLiEOuw/rSwyMgTvs8qoQRr7sqb8yV/arOOKZH
/wmQt77WNGt5XWLNOfIhZ0PcGhAYu7ZpU8dZhRGIEtbz5OXA2Hd3ybE1Aiof5wYH
9MvpLCChonctkXFw9QhkZK9wN+CPdldrY4cfENYkKHxQvhhfNfPZXdDISR+Z43L9
rQb/9ZlBxapdqaAdGKADAGo1lb2AXEfSMJuf6/pIgsHFFbk7VLXNSFPE/DhnfDyV
cumRQYod+qeMX1lsLnbVUPa69Q5ZFqvpzR+4hUd9E69pcAeuoifrfeS667rp3I3x
anX230trFnzBNaOOlfFMPTwaqagKFX5Q+y2Hzu/d1bWote8+TpDTwZadeFYUdFs2
jwtAIi6UV5Okbx9qjqLD5jNU5nWccm2fSEOWDI73IvKA0SMtj9DDZ83frH7rOSsH
OACVFi6cJaoGcitUzcXMHFCbQqZPtJaKJrqhkv2/orzMA9DTlV+UZyXWKK2w+ycZ
ncFtNF1AUZNJ4afpbl8lqun1Du+Dm05ShxdeyYI6jqE/XSYmeZzOFuioDRpgp7Hs
UUDKmE6kkT2h0LZY0y+reML6uRYmOLc41+Nz2Nc6h+gUvqFuIbPi25LLfbdoSFbc
HsvrZXSiFLY9uGan/DZa
=jK2Y
-----END PGP SIGNATURE-----

This php files are html files with php embeeded. They use to work ona browser, but the don’t now, I don’t know why. Since I update to suse 12.2 some things had changed.

Am 07.11.2012 04:56, schrieb agunet74:
>
> This php files are html files with php embeeded. They use to work ona
> browser, but the don’t now, I don’t know why.
>

php files do not work in a webbrowser, php files work in a webserver and
deliver from that webserver content to your webbrowser, that is a
tremendous difference.


PC: oS 12.2 x86_64 | i7-2600@3.40GHz | 16GB | KDE 4.8.5 | GeForce GT 420
ThinkPad E320: oS 12.2 x86_64 | i3@2.30GHz | 8GB | KDE 4.9.2 | HD 3000
eCAFE 800: oS 11.4 i586 | AMD Geode LX 800@500MHz | 512MB | lamp server

Now what are they?
PHP files can have embedded HTML.
How can HTML files have embedded PHP?

What files are they? Remind that the sole fact that the name of a file ends with the character string .html or .php does not make them HTML or PHP files. The contents of files is what makes them HTML or PHP files. Those name endings are only a convention, and needed to be done correct for the whole to function because many applications (like Apache, but browsers are not amongst them) work with that convention.

If you doubt what those files are, you could post (at least the first 20 lines or so of) one of them here for scrunity.

Also you are rather vague. A Webbrowser: which one(s)? You “click on a file”: in which application? And so on.

hcvv wrote:
> agunet74;2501784 Wrote:
>> This php files are html files with php embeeded. They use to work ona
>> browser, but the don’t now, I don’t know why. Since I update to suse
>> 12.2 some things had changed.
> Now what are they?
> PHP files can have embedded HTML.
> How can HTML files have embedded PHP?

It doesn’t really matter. If agu wants either HTML or PHP pages to
‘work’ then they need to be served by his web server.

agu, what is the full path to the files that you are trying to open?
And what do you type in the URL bar of your browser?

Sorry, but as I read his first post, he does not type an URL in a browser. He “clicks on the file” (probably in a file manager of some kind) and then there seems to be no association of the file type (either by the tail of it’s name or by the contents) to a certain application (except editors) and the OP seems to expect that one or more browsers should be offered as a suitable application to open the file.

I was trying to open te file instead of writing the URL into the URL Direction bar.

It’s working good as always.

Thank your all for your feedbacks.

cheers

agu