Results 1 to 5 of 5

Thread: PHP help with Mac OS X Snow Leopard

  1. #1
    Join Date
    Apr 2010
    Posts
    76

    PHP help with Mac OS X Snow Leopard

    Hi all,

    I use a Macbook 4GB RAM 2.26 GHz Intel processor and I am trying to viewing the php files on my Mac. So I save the files with the extension. Php but when I go to open the file using Safari browser, it only shows the HTML tags and ignores the php script (the <? Php / php code /?. "So I found this great thing that MAMP creates a local server or something and before I used to use XAMPP on a Windows machine. Is anyone familiar with MAMP on a Mac or in general how to turn change the Apache server in Mac or something so that I can see my PHP files, but for my class?

    I need PHP help with Mac OS X Snow Leopard.

  2. #2
    Join Date
    Apr 2008
    Posts
    2,572

    Re: PHP help with Mac OS X Snow Leopard

    MAMP was created primarily as a PHP development environment for Macintosh computer and should therefore not be used as Live Webserver for the Internet. In this case, we recommend that you use Mac OS X server with the provided Apache or a Linux server.
    But I want to know Why do you think that you should be "changing the Mac Apache server" for viewing these files?

    You are not really using the Apache server portion of the operating system.

  3. #3
    Join Date
    Apr 2010
    Posts
    76

    Re: PHP help with Mac OS X Snow Leopard

    Hi,

    Thanks for replying. I want to view php files because it is a part of the computer science course which I have taken in school. If anyone could possibly provide an answer to this question as to how to view php scripts that is also embedded within html codes. I am using Windows machine with XAMP, but that was with a database course with phpMyadmin. If you could help me, to solve this problem then that would be readily appreciated.

  4. #4
    Join Date
    Oct 2005
    Posts
    2,358

    Re: PHP help with Mac OS X Snow Leopard

    For installing PHP on Snow Leopard you have to follow these simple steps.

    Start Apache
    sudo apachectl start
    Check it's working: http://localhost/
    In /etc/apache2/httpd.conf, uncomment this line:
    Code:
    LoadModule php5_module        libexec/apache2/libphp5.so
    Restart Apache
    sudo apachectl restart
    Fix a warning appearing in phpinfo()
    Create /etc/php.ini and make it writable
    Code:
    cd /etc
    sudo cp php.ini.default php.ini
    sudo chmod 666 php.ini
    In php.ini, find this line:
    Code:
    ;date.timezone =
    Uncomment it and insert your time zone
    Code:
    date.timezone =America/Vancouver
    Restart Apache
    Code:
    sudo apachectl restart
    I'm the Proud Owner of the most dangerous weapon
    known to man kind: Human Brain

  5. #5
    Join Date
    Apr 2010
    Posts
    76

    Re: PHP help with Mac OS X Snow Leopard

    I have enabled the php in the httpd.conf, copied php.ini.default to php.ini, and it working good with
    <?php phpinfo(); ?>


    One more thing, when I tried to connect to the running MySQL 5.1.38 database through php, But I am getting the error display that is "unable to connect", can anybody help to get rid of this error problem.

Similar Threads

  1. Replies: 5
    Last Post: 20-10-2010, 02:09 AM
  2. Can i reinstall Leopard from Snow Leopard
    By Abhisar G in forum Hardware Peripherals
    Replies: 5
    Last Post: 03-08-2010, 05:40 AM
  3. Is Snow Leopard is having JDK 1.3?
    By Bangari in forum Operating Systems
    Replies: 5
    Last Post: 28-05-2010, 06:12 PM
  4. Snow Leopard VPN
    By Xylina in forum Networking & Security
    Replies: 4
    Last Post: 27-05-2010, 05:52 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,312,017.65630 seconds with 17 queries