Including files of different types in PHP

I took over the PHP project and I am trying to run it in my dev block. I am a developer, not a system administrator, so I have problems with his work.

The previous developer used .h files to enable PHP. My current configuration accepts this .h file and includes it without executing it. What do I need to look for in my apache configuration (or is it my php.ini)?

EDIT:

Something clicked when I read one of the comments below. The code uses ASP " <?" style tags . I have included this option in php.ini, and according to phpinfo (), it is activated, but apache still includes the code in the form of text.

I just checked it and ran the code with the full PHP opening tag " <?php". Having said that, I still enjoy working in a different way.

I am running code on a Macbook with the latest versions available. PHP 5.2.6, postgresql 8.3 and apache 2.

The code runs on an intermediate server, but I can’t understand what the difference is.

EDIT

Durrr ... I did not have short_open_tags included in php.ini.

+3
source share
6 answers

Could the problem be that the .h file that you include only starts with php code without opening the <tag <?php?

From the include documentation:

, PHP HTML . , PHP-, PHP.

+6

PHP - , "" . , ".h" - , , PHP .h, PHP.

, , .

+2

.htaccess :

php_value auto_prepend_file/path/to/include-file.h


, .htaccess php.

+1

.php. , .h, Apache. Apache, , PHP. PHP , .

+1
0

.h "" <?php, include - :

eval( file_get_contents("file.h") );

eval , , .

-1

Source: https://habr.com/ru/post/1705912/


All Articles