PHP stopped working on Apache after upgrading to OS x 10.10.1 Yosemite - Owncloud is broken

Context: I'm trying to run Apache on local Mac27 "(2009) so that I can use OwnCloud as an alternative to Apple iCloud (I just want to do my calendar locally sync like in good" OS X big cat days. For paranoid reasons of integrity, I don't want Cupertino to know who I know or what I am doing - maybe wrong, but there you go). My foray into this was based on a blog post by Michael Gracie at http://michaelgracie.com/2013/11/13/getting-ios-7-calendar-and-contacts-syncing-directly-with-os-x-10- 9-mavericks / (thanks a lot for that).

When I moved to Yosemite a few weeks ago (remind me why I did this?) I took the time to fix my very basic setup and I went back. Yesterday I updated (again, remind me why I did this?) To 10.10.1 and it broke again. Everything seems to work, but PHP is not working.

The symptom is that when I start OwnCloud (localhost / owncloud / index.htm) I get OwnCloud logo and style and then the error:

PHP module GD is not installed.
Please ask your server administrator to install the module.

      

This is however a leak because it is not a GD module, which is the problem - I think Apache is not seeing PHP at all. The reason is this:

1) Does PHP work on Apache?

When I go to:

http://localhost

      

I see Apache "It works!" message.

Adapting the index.html.en file in / Library / Webserver / documents / allows me to change this message, however when I call PHP from that file eg.

    <h1>It works!</h1>
    <h2>This file is in /Library/Webserver/Documents</h2>
    <h3>Trying to printout phpinfo()</h3>
    <?php
            echo phpinfo();
    ?>

      

Then I see three lines of text, but no PHP information.

So PHP is not available when rendering this web page.

2) Is PHP available at all?

Investigating this, I run the following command from the terminal:

sudo echo <?php phpinfo() ?> | php

      

and I am getting four thousand lines of PHP information which includes

'--with-gd'

      

in the configure command.

3) Has Apache loaded the PHP module?

Then I run:

httpd -t -D DUMP_MODULES

      

Apache tells me that among many other modules it uses:

php5_module (shared)

      

4) Is the httpd.conf file compatible with this:

I went through httpd.conf in the / etc / apache 2 directory and uncommented the following lines:

LoadModule php5_module        libexec/apache2/libphp5.so
LoadModule authn_core_module libexec/apache2/mod_authn_core.so
LoadModule authz_host_module libexec/apache2/mod_authz_host.so

      

5) What else?

To complete the image, in the / etc / apache 2 / users file, I set up my own user preferences:

<Directory "/Users/DJBrown/Sites/">
    Options Indexes MultiViews FollowSymLinks
    Require all granted
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

      

(I admit that at this point - as others have said - I'm really not quite sure what I'm doing, since I'm doing a lot of this from some of the other answers on StackOverflow).

6) Conclusion

Apache works with PHP, and HTTP and PHP can be queried from the command line ... but Apache won't run PHP.

Is it possible?

What did I miss?

Any help is gratefully received.

Dj

+3


source to share


1 answer


Here's a partial answer.

Changing line in httpd.conf

AddType application/x-httpd-php .php

      

to

AddType application/x-httpd-php .php .htm .html

      



Allows apache to render inline PHP code in HTML files.

(I got this from http://php.about.com/od/advancedphp/p/html_php.htm )

I still have a problem with OwnCloud which I will take to their forum

Thanks for your help birdpider

Dj

+1


source







All Articles