Opened 5 years ago

Closed 5 years ago

#50145 closed defect (worksforme)

PHP70 not interpreted in Apache 2.2

Reported by: Behinder (behinder) Owned by: ryandesign (Ryan Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.3.4
Keywords: Cc:
Port: apache2

Description

The same configuration of apache. if php70 selected and 7.0 module loaded by httpd.conf php files are not recognized just simple file with phpinfo() when loaded php56 everything is OK. So As I said looks php70 not work with 2.2 and it is also suggested in: http://stackoverflow.com/questions/34153047/using-php-7-with-wamp

Change History (8)

comment:1 Changed 5 years ago by ryandesign (Ryan Schmidt)

Owner: changed from macports-tickets@… to ryandesign@…

comment:2 Changed 5 years ago by ryandesign (Ryan Schmidt)

I'm not able to reproduce this problem. php70-apache2handler works fine for me with apache2.

Ensure that the line

Include conf/extra/mod_php70.conf

appears in your httpd.conf.

comment:3 Changed 5 years ago by Behinder (behinder)

There was no such line in my httpd.conf I added it but the problem remains. modphp70.conf doesn't do much because I had the same set of AddType rules in my httpd.conf

So to summarize: php70-apache2handler was installed httpd.conf is properly set

php 7 not working with 2.2 php 56 working correctly

What about this stackoverflow link that I provided when someone else mentioned these two won't work together?

comment:4 Changed 5 years ago by ryandesign (Ryan Schmidt)

Most of that stackoverflow post seemed pointless to me since it's talking about problems specific to Windows. I don't know why it says that PHP 7 doesn't work with Apache 2.2, because it works fine for me, at least to the point of showing the phpinfo page.

Just to make sure you understand: You can only load one version of the PHP Apache 2 module into Apache at a time. For example, you can either load the PHP 5.6 Apache 2 module, or the PHP 7.0 Apache 2 module, but not both.

comment:5 Changed 5 years ago by Behinder (behinder)

Yes I understand. I tested it twice: with module 56 active with module 70 active

5.6 works , 70 does not. phpinfo page is not showing up. So you are probably lucky or there is Murphy law here.

comment:6 Changed 5 years ago by Behinder (behinder)

Now, this is weird. I tried once again to test. Put LoadModule declaration in proper place. Added the config as you suggested but now php files are downloaded by Safari instead of interpreted.

comment:7 Changed 5 years ago by Behinder (behinder)

Ok I found solution. It looks I have missing line in Apache configuration:

AddHandler php7-script .php

I needed to comment out:

AddHandler php5-script .php
Last edited 5 years ago by ryandesign (Ryan Schmidt) (previous) (diff)

comment:8 Changed 5 years ago by ryandesign (Ryan Schmidt)

Resolution: worksforme
Status: newclosed
Note: See TracTickets for help on using tickets.