Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

sawmaster

macrumors regular
Original poster
If i try to open a PHP file in safari, it shows the code. If the PHP file isn't local, for example, on a local website (using air sharing on my ipod touch and adding php files to it), it will download the file. If I open it there, it will only display the codes like it does on the original file on my mac. I'm trying to use wordpress but it doesn't work. Once I think i saw some of the page working (it was the login page and it was PHP). But i've tried everything i could do but it never worked again. Please help me! Thanks!
 

JNB

macrumors 604
php files cannot be viewed as the intended page by merely "opening" them. WP has to be installed on a host on top of a (typically) mySQL db. You have to point the installation to the correct database for proper service. Read the WP installations carefully and follow them explicitly. It works just fine if you follow the directions.

Here's the install instructions. You have to run the install.php after FTP'ing to your host.
 

themoonisdown09

macrumors 601
Nov 19, 2007
4,319
18
Georgia, USA
php files cannot be viewed as the intended page by merely "opening" them. WP has to be installed on a host on top of a (typically) mySQL db. You have to point the installation to the correct database for proper service. Read the WP installations carefully and follow them explicitly. It works just fine if you follow the directions.

Here's the install instructions. You have to run the install.php after FTP'ing to your host.

I guess I didn't read the OP's post all the way because I missed that he was using WordPress.
 

sawmaster

macrumors regular
Original poster
I GOT IT! I have the installation PHP file working. It's hosted on my ipod touch using air sharing. The page though, looks awful! lol And when i try entering my details, (i'm guessing the box above is the username and the box below is the password lol) then i press this strange button with a code in it. It looks like it's suppost to say Install Word Press. If I click that, it just does nothing. :(
 

memco

macrumors 6502
May 1, 2008
259
2
If you're running this on your ipod you're going need to find a server of some kind with PHP and MySQL support. I can't remember if it exists, but I know I've read at least one person has used the iPhone/iPod as a web-server. PHP pages can't simply be opened, they have to be interpreted by a server first, which requires some local installation and customization.
 

sawmaster

macrumors regular
Original poster
If you're running this on your ipod you're going need to find a server of some kind with PHP and MySQL support. I can't remember if it exists, but I know I've read at least one person has used the iPhone/iPod as a web-server. PHP pages can't simply be opened, they have to be interpreted by a server first, which requires some local installation and customization.

Well, I fixed my server. If I go to my url, http://71.193.112.221/~sawmaster/wordpress/ , it still doesn't work.

I don't always host this from my iPod. I was just doing it that way temporary.

Does anybody have any luck with the url above?

And I got the Apache server. Not any other kind of server.
 

Darth.Titan

macrumors 68030
Oct 31, 2007
2,905
753
Austin, TX
You have some work to do with your Apache config. It's not interpreting the PHP code, it's just dishing it out as text.

There are 100 how-tos around for configuring Apache on most versions of OS X. Google is your friend.

BTW, posting a link to your personal machine via IP on a public message board is probably not the best idea...
 

sawmaster

macrumors regular
Original poster
You have some work to do with your Apache config. It's not interpreting the PHP code, it's just dishing it out as text.

There are 100 how-tos around for configuring Apache on most versions of OS X. Google is your friend.

BTW, posting a link to your personal machine via IP on a public message board is probably not the best idea...

I thought it wasn't a good idea..

For some reason, it seems that I keep doing wrong things lol. I bumped this thread. I got a warning.
 

nelmat

macrumors 6502a
Jul 10, 2008
798
58
PHP/MySQL on mac

Go grab a copy of mamp and get yourself up and running. You simply haven't enabled PHP properly. The MAMP installation is the simplest PKG way of doing this for newbies. Hope that helps.
 

sawmaster

macrumors regular
Original poster
What I just did to an apache file:

I edited the config file in the apache server.
Location: ect/httpd/httpd.conf

I didn't feel like looking through the entire page to find what to un-comment. So I searched for php by clicking (on the menu bar), Edit>>Find>>Find...
And I searched for PHP. This is the first result:
Code:
# Dynamic Shared Object (DSO) Support
#
# To be able to use the functionality of a module which was built as a DSO you
# have to place corresponding `LoadModule' lines at this location so the
# directives contained in it are actually available _before_ they are used.
# Please read the file http://httpd.apache.org/docs/dso.html for more
# details about the DSO mechanism and run `httpd -l' for the list of already
# built-in (statically linked and thus always available) modules in your httpd
# binary.
#
# Note: The order in which modules are loaded is important.  Don't change
# the order below without expert advice.
#
# Example:
# LoadModule foo_module libexec/mod_foo.so
#LoadModule vhost_alias_module libexec/httpd/mod_vhost_alias.so
#LoadModule env_module         libexec/httpd/mod_env.so
LoadModule config_log_module  libexec/httpd/mod_log_config.so
#LoadModule mime_magic_module  libexec/httpd/mod_mime_magic.so
LoadModule mime_module        libexec/httpd/mod_mime.so
LoadModule negotiation_module libexec/httpd/mod_negotiation.so
#LoadModule status_module      libexec/httpd/mod_status.so
#LoadModule info_module        libexec/httpd/mod_info.so
LoadModule includes_module    libexec/httpd/mod_include.so
LoadModule autoindex_module   libexec/httpd/mod_autoindex.so
LoadModule dir_module         libexec/httpd/mod_dir.so
LoadModule cgi_module         libexec/httpd/mod_cgi.so
LoadModule asis_module        libexec/httpd/mod_asis.so
LoadModule imap_module        libexec/httpd/mod_imap.so
LoadModule action_module      libexec/httpd/mod_actions.so
#LoadModule speling_module     libexec/httpd/mod_speling.so
LoadModule userdir_module     libexec/httpd/mod_userdir.so
LoadModule alias_module       libexec/httpd/mod_alias.so
LoadModule rewrite_module     libexec/httpd/mod_rewrite.so
LoadModule access_module      libexec/httpd/mod_access.so
LoadModule auth_module        libexec/httpd/mod_auth.so
#LoadModule anon_auth_module   libexec/httpd/mod_auth_anon.so
#LoadModule dbm_auth_module    libexec/httpd/mod_auth_dbm.so
#LoadModule digest_module      libexec/httpd/mod_digest.so
#LoadModule proxy_module       libexec/httpd/libproxy.so
#LoadModule cern_meta_module   libexec/httpd/mod_cern_meta.so
#LoadModule expires_module     libexec/httpd/mod_expires.so
#LoadModule headers_module     libexec/httpd/mod_headers.so
#LoadModule usertrack_module   libexec/httpd/mod_usertrack.so
LoadModule log_forensic_module libexec/httpd/mod_log_forensic.so
#LoadModule unique_id_module   libexec/httpd/mod_unique_id.so
LoadModule setenvif_module    libexec/httpd/mod_setenvif.so
#LoadModule dav_module         libexec/httpd/libdav.so
#LoadModule ssl_module         libexec/httpd/libssl.so
#LoadModule perl_module        libexec/httpd/libperl.so
#LoadModule php4_module        libexec/httpd/libphp4.so
LoadModule hfs_apple_module   libexec/httpd/mod_hfs_apple.so
LoadModule bonjour_module     libexec/httpd/mod_bonjour.so

And un-commented after the example.
Today, it now looks like this:
Code:
# Dynamic Shared Object (DSO) Support
#
# To be able to use the functionality of a module which was built as a DSO you
# have to place corresponding `LoadModule' lines at this location so the
# directives contained in it are actually available _before_ they are used.
# Please read the file http://httpd.apache.org/docs/dso.html for more
# details about the DSO mechanism and run `httpd -l' for the list of already
# built-in (statically linked and thus always available) modules in your httpd
# binary.
#
# Note: The order in which modules are loaded is important.  Don't change
# the order below without expert advice.
#
# Example:
# LoadModule foo_module libexec/mod_foo.so
LoadModule vhost_alias_module libexec/httpd/mod_vhost_alias.so
LoadModule env_module         libexec/httpd/mod_env.so
LoadModule config_log_module  libexec/httpd/mod_log_config.so
LoadModule mime_magic_module  libexec/httpd/mod_mime_magic.so
LoadModule mime_module        libexec/httpd/mod_mime.so
LoadModule negotiation_module libexec/httpd/mod_negotiation.so
LoadModule status_module      libexec/httpd/mod_status.so
LoadModule info_module        libexec/httpd/mod_info.so
LoadModule includes_module    libexec/httpd/mod_include.so
LoadModule autoindex_module   libexec/httpd/mod_autoindex.so
LoadModule dir_module         libexec/httpd/mod_dir.so
LoadModule cgi_module         libexec/httpd/mod_cgi.so
LoadModule asis_module        libexec/httpd/mod_asis.so
LoadModule imap_module        libexec/httpd/mod_imap.so
LoadModule action_module      libexec/httpd/mod_actions.so
LoadModule speling_module     libexec/httpd/mod_speling.so
LoadModule userdir_module     libexec/httpd/mod_userdir.so
LoadModule alias_module       libexec/httpd/mod_alias.so
LoadModule rewrite_module     libexec/httpd/mod_rewrite.so
LoadModule access_module      libexec/httpd/mod_access.so
LoadModule auth_module        libexec/httpd/mod_auth.so
LoadModule anon_auth_module   libexec/httpd/mod_auth_anon.so
LoadModule dbm_auth_module    libexec/httpd/mod_auth_dbm.so
LoadModule digest_module      libexec/httpd/mod_digest.so
LoadModule proxy_module       libexec/httpd/libproxy.so
LoadModule cern_meta_module   libexec/httpd/mod_cern_meta.so
LoadModule expires_module     libexec/httpd/mod_expires.so
LoadModule headers_module     libexec/httpd/mod_headers.so
LoadModule usertrack_module   libexec/httpd/mod_usertrack.so
LoadModule log_forensic_module libexec/httpd/mod_log_forensic.so
LoadModule unique_id_module   libexec/httpd/mod_unique_id.so
LoadModule setenvif_module    libexec/httpd/mod_setenvif.so
LoadModule dav_module         libexec/httpd/libdav.so
LoadModule ssl_module         libexec/httpd/libssl.so
LoadModule perl_module        libexec/httpd/libperl.so
LoadModule php4_module        libexec/httpd/libphp4.so
LoadModule hfs_apple_module   libexec/httpd/mod_hfs_apple.so
LoadModule bonjour_module     libexec/httpd/mod_bonjour.so

I had no idea what people mean when they want other people to restart apache. So I un-checked "Personal Web Sharing" in the Sharing panel. Then I rechecked it. Everything works fine. Except PHP.

REMEMBER: I'm trying to use wordpress.

Also, when I type in "/wordpress/" on my site, instead of seeing the default apache file browser, I see a fancy wordpress file browser. Amazing! This story gets more suspishish and exiting and intense!
 

sawmaster

macrumors regular
Original poster
Go grab a copy of mamp and get yourself up and running. You simply haven't enabled PHP properly. The MAMP installation is the simplest PKG way of doing this for newbies. Hope that helps.

Exuse me a moment, i'm going to go to a party celebrating THIS SWEEEEETTTTT APPLICATION!!!! THANKS LIKE DEAD CRAZY! THHAATAAANKS!!!


Pardon my exitedness. :D:D:D:D:D
 

moosa

macrumors newbie
Nov 19, 2009
1
0
Melbourne, Vic
Re:

Well... I am having the same problem and I didnt have any trouble installing MAMP and my servers are running absolutely fine. Can anyone tell me why I am getting this error message and Safari wont open the install.php file?
 

angelwatt

Moderator emeritus
Aug 16, 2005
7,852
9
USA
Well... I am having the same problem and I didnt have any trouble installing MAMP and my servers are running absolutely fine. Can anyone tell me why I am getting this error message and Safari wont open the install.php file?

What error message?
How are you trying to open the install.php file?
 

JakeGWood

macrumors newbie
Jul 3, 2011
8
0
I had a similar problem, but I am not using wordpress. However, after using the foundationphp.com link, my browsers correctly read .php, but only in the MacintoshHD>Library>Webserver>Documents folder. But when I put the .php files anywhere else, in my case the desktop, my browsers view the file as textedit would view it, and then download the file. So how could I get .php files read correctly from any address?
 

Brandon Sky

macrumors newbie
Feb 27, 2012
3
0
Safari doesn't support PHP

Safari versions prior to 5.0 do not support PHP. I have tested PHP on Opera, Firefox, Google Chrome, and Camino. It seems it only works with these four browsers. I tested PHP with Safari 5.1 and it works.
 

nelmat

macrumors 6502a
Jul 10, 2008
798
58
Safari versions prior to 5.0 do not support PHP. I have tested PHP on Opera, Firefox, Google Chrome, and Camino. It seems it only works with these four browsers. I tested PHP with Safari 5.1 and it works.

That is wrong. safari fully supports php and always has. check your code!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.