1

I am trying to make a php script run to make the first test on the browser but it doesn't work. When I try to open the link it shows me the following:

<?php phpinfo(); ?>

Currently I have PHP 7.1.3 installed and Apache 2.4.25 in a Amazon VM with AMI. And the file phpinfo.php contains the same showed above by the browser.

Below some commands to confirm.

php -v PHP 7.1.3 (cli) (built: Mar 26 2017 15:36:12) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies

httpd -v Server version: Apache/2.4.25 (Amazon) Server built: Jan 19 2017 16:55:49

In the file http.conf I took the following actions:

Updated a section:

`<IfModule dir_module>`
    `DirectoryIndex /index.php index.php index.html`
`</IfModule>`

Inserted some lines:

`<FilesMatch \.php$>`
`   SetHandler application/x-httpd-php`
`</FilesMatch>`
`<FilesMatch \.phps$>`
`   SetHandler application/x-httpd-php-source`
`</FilesMatch>`
`AddType application/x-httpd-php-source .phps`

I would appreciate some help on this. Please let me know if I can provide any other information that might help on solving this issue.

Thanks in advance

PaulG
  • 13,871
  • 9
  • 56
  • 78
JADSAM
  • 143
  • 1
  • 2
  • 6
  • did you try running it from the bash line? – Forbs Mar 27 '17 at 03:42
  • Might just need to add `LoadModule php7_module modules/libphp7.so` to the apache config. – Orangepill Mar 27 '17 at 05:13
  • Instructions can be found [here](http://de2.php.net/manual/en/install.unix.apache2.php). Make sure you've followed all the steps. Also, I hope those backticks are just transcription errors. – Álvaro González Mar 27 '17 at 08:24
  • Thanks for the help but it seems I cannot not complete this step LoadModule php7_module modules/libphp7.so. After searching in all the server for this file libphp7.so and libphp*.so it was not created. I followed these instructions http://www.linuxfromscratch.org/blfs/view/svn/general/php.html to install php 7.1.3. Is there an specific instruction to create this module in particular? – JADSAM Mar 27 '17 at 09:21
  • If you want to compile PHP from source code then it's a fairly different question. Surely, the Apache module is not mandatory (you need the `--with-apxs2` switch). – Álvaro González Mar 27 '17 at 09:52
  • Thanks for your support after recompiling it worked – JADSAM Mar 28 '17 at 23:32

0 Answers0