WordPress.org

Forums

PHP code shown only as text (5 posts)

  1. jenzen
    Member
    Posted 2 years ago #

    Hi WordPress people,

    I've installed succesfully MySQL and Apache to my MacBook Pro (I'd like to run WordPress first locally). But there's obviously something wrong with the PHP settings (or something) because PHP code is shown only as text in web pages. It's the same with wb-config.php and simple hello world stylish php files.

    I edited the httpd.conf file - deleted the # in front of the line LoadModule php5_module libezec/apache2/libphp5.so. I copied php.ini.default file to php.ini file without making any changes.

    Any ideas how to fix this?

    Thank you for your time and help already in advance!

  2. Hey. Have you followed all the instructions given in the PHP.net docs for this? - http://www.php.net/manual/en/install.macosx.bundled.php

  3. jenzen
    Member
    Posted 2 years ago #

    Hi Siobhyb,

    ok, good. There's still something not exactly right... The second step in the php.net instructions asks to uncomment the first line here below, and in my /private/etc/apache2/httpd.conf file I can only find the following line (which I have uncommented).
    # LoadModule php5_module libexec/httpd/libphp5.so
    LoadModule php5_module libexec/apache2/libphp5.so

    I can't find anything related to this line. Should I add it somewhere in the file?
    # AddModule mod_php5.c

    And should I also add the mod_php5.c code in the step 3?

    I followed the instructions in this page
    http://php.about.com/od/phpbasics/ss/installMac_2.htm

    Thank you!

  4. Suzette Franck
    Member
    Posted 2 years ago #

    Not sure which tools you are using to install everything, but Desktop Server will install everything and install WordPress and has a blueprint feature. The dev is super helpful with any issues.

  5. Eric Amundson
    Volunteer Moderator
    Posted 2 years ago #

    Hey jenzen,

    I never mess with setting up PHP and MySQL directly on the Mac; only on Linux. I tend to 'cheat' and use MAMP or XAMMP.

    IMO, it's much easier. If you're a tinkerer, and feeling ambitious, you could also try Vagrant:

    https://github.com/10up/varying-vagrant-vagrants

    I think MAMP's your easiest bet, though.

Topic Closed

This topic has been closed to new replies.

About this Topic