VIEWING PHP FILES ON MAC

Can any body tell me if it is possible to view .php files from a web site on a mac ? When I click on link in email to download the file it opens a web page that say please wait will your page is loading at the same time it downloads a file called LOADEMAILKIT.PHP but that is as far as it goes, It never loads the file for viewing. I have tried many things but no success.

mac book 2.4 gig 250 gig OS 10.6.3, Mac OS X (10.6.3), 4 gigs of ram

Posted on Jun 15, 2010 12:25 PM

16 replies

Jun 15, 2010 12:54 PM in response to Community User

You shouldn't receive the PHP file. PHP is a scripting language that allows you to make web pages with dynamic content. The web-server that sent you the file is supposed to be configured to read in the PHP file, run the instructions inside it, and return to you HTML (a web page) or other data.

You can, of course, place the file in your Sites directory and then enable web-sharing in the system preferences (under Sharing). Then, you ought to be able to see the file at http://localhost/~name/loademailkit.php (replace 'name' with your short user name, and make sure that you changed the PHP file to be all lower case). HOWEVER, there's the problem that the PHP script will generally reference resources on the server where it originated, so it may not do anything at all.

If you'd simply like to see the PHP programming code, start up your favorite text editor and drag the PHP file's icon onto the icon for the text editor.

Jun 16, 2010 12:28 PM in response to Community User

Hey there,

I believe what is happening, is instead of sending you a .pdf file, the server is sending you this .php file in error. Something might be wrong with the script being used to process your request, or might require some other action in order to download the file.

The .php file that gets downloaded is essentially a text file containing code which directs the server on what to do when the request is made, so it is not surprising that when you open it, all you are seeing is the code in this file.

Perhaps the server requires you to log in before accessing the .pdf file? Try logging in and then trying the download again.

If that doesn't work, I might suggest you contact the site owner to report the problem. It might very well be an issue on their end.

Jun 18, 2010 8:42 AM in response to Community User

dlabc563 wrote:
Thanks for the info but If I understand correctly this info is for building a web-server ? All I want to do is view these pages sent to me via link in email. Please advise !

Regards
dlabc563


Copy the link then paste it into your web browser's address bar. View the page in the web browser. If the page does not display in the web browser then there is a coding error in the page located on the server.

Jun 18, 2010 9:03 AM in response to Community User

Then either the site in question has exquisitely poorly-written PHP code that is IE-specific and fails on other browsers, or you've got something different on the Windows setup (like maybe it remembers a login). Ultimately, though, unless you can give us a link to the page where you're seeing this problem, there's not much specific we can tell you. If it's failing to work in Safari, and you're sure you are doing everything right (logging in correctly if necessary, etc), try Firefox. If it doesn't work in Firefox either, you need to talk to the site owner or developer.

Jun 18, 2010 12:03 PM in response to Community User

Note that, if there's no login, that info isn't actually private. It's at best secure by obscurity (meaning secure only with the assumption that nobody knows it's there), which isn't really secure at all. If this is private info, it shouldn't just be on the web without any access limitations. Of course, that's got nothing to do with your question, just a note.

Also, once the sample is ready, check it yourself to be sure it exhibits the same problem before posting the link here. It's entirely possible that the sample won't suffer from the same issue.

Jun 16, 2010 6:19 AM in response to J D McIninch

I should clarify,I can view the file when double click there are 2 choices 1-open web page which show me the realtor login page for realtors which is not what I need , 2-open,when I choose 2 this is what I see, it open the named loademailkit.php file but it is in the wrong format it looks like simple text like code, it should a pdf format.

Regards
dlabc563

Jun 16, 2010 8:32 AM in response to Community User

On an other but related topic, I wonder if you could tell how to view hidden files without using a third party app. like textwrangler to view or edit hidden files, thanks

P.S. I tried what you suggested for .php viewing not luck !

Regards
dlabc563

Jun 18, 2010 5:56 AM in response to Jolly Giant

Thanks for the info but If I understand correctly this info is for building a web-server ? All I want to do is view these pages sent to me via link in email. Please advise !

Regards
dlabc563

Jun 18, 2010 9:49 AM in response to thomas_r.

What do you mean by login in correctly, login in the web-server of that link or login in to safari ?
I am waiting for my agent to send me test link to that server-page when I get it I will pass it on to you.

Regards
dlabc563

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

VIEWING PHP FILES ON MAC

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.