Hello, I am having problems getting PHP to recognize a .inc file, I installed all of the default stuff, and when I pull up my index.php page the .inc file doesn’t get parsed.
Is there anything extra I should have to do to get a .inc file working, like edit the php5.conf file?
Normally users don’t request the .inc files directly. In fact usually they are not allowed to fetch them directly because they might contain things like MySQL account names and passwords. They are included by the .php files using directives such as:
require_once “library/util.inc”;
If those requires don’t work, have a look in /var/log/apache2/error_log to see what the problem is.
I’m not trying to get users to be able to recognize the .inc, I want the php pages to.
All I am saying in my code is:
<? include 'imports.inc'; ?>
The apache error log doesn’t have anything related to the problem, I’ll check the php error log when I get home.
Edit:
lol now that I actually posted the code I’m realizing my mistake, the <? no longer seems to work in php, not sure what version they got rid of it in. Had this problem on other pages as well, but I forgot about it.
<? ?> (short-open-tags parameter in php.ini) has not been the default for
a while, and I believe may even be deprecated, though don’t quote me on
that without checking php.net’s docs. Anyway, use the full tags.
Good luck.
ken yap wrote:
> adaykin;2014821 Wrote:
>> lol now that I actually posted the code I’m realizing my mistake, the
>> <? no longer seems to work in php, not sure what version they got rid of
>> it in. Had this problem on other pages as well, but I forgot about it.
>
> Yes, and you have realised by now that nothing would have worked inside
> <? ?> and had nothing to do with the .inc.
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org