0

When I add phpinfo(); to a running site's index.php (or even a blank page), the server sends an empty response. Relevant info:

  • If I remove phpinfo(); the page(s) behave as expected. The sites also respect the Apache redirect directives.
  • I use MacPorts for both PHP and Apache
  • I recently upgraded to the latest macOS and the latest version of MacPorts.
  • I already ran sudo port upgrade outdated
  • phpinfo works on the command line (not surprising).
  • The php.ini file does not include phpinfo in the disable_functions list.
cwallenpoole
  • 79,954
  • 26
  • 128
  • 166

1 Answers1

0

It turns out it is an issue with the PHP enchant library. There is already a bug reported related to this.

The user actually created a particularly useful script which I've copied below:

#!/usr/bin/env bash

# list installed, don't try to deactivate php56-apache2handler|php56-curl because of dependencies
for thePort in $( port echo installed | awk '{if($1~'/^php56-/') print $1 ;}' | grep -v -E 'php56-apache2handler|php56-curl' ) ; do
    # try do deactivate a module
    echo -n "Test without $thePort : " 
    port deactivate $thePort
    if [ ! "$?" -eq "0" ] ; then
        echo "Error for deactivate"
        exit 1
    fi
    # began tests 
    /opt/local/bin/php -i &> /dev/null
    if [ ! "$?" -eq "0" ] ; then
        echo "ERROR php -i"
    else
        echo "OK"
        echo -n "Web test : "
        port unload apache2
        sleep 2
        port load apache2
        sleep 1
        # The address of the web server; <?php phpinfo(); in the file
        curl http://127.0.0.1/info.php &> ~/tmpCurlOut
        # If the curl command exits with an error, then we've 
        if [ ! "$?" -eq "0" ] ; then
            echo "web test past"
        else
            echo "Faulty module is $thePort"
            exit 1      
        fi      
    fi
    # on reactive
    port activate $thePort
    if [ ! "$?" -eq "0" ] ; then
        echo "Error for activate"
        exit 1
    fi
done
cwallenpoole
  • 79,954
  • 26
  • 128
  • 166