Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Why Safari on Mac OS X can execute processingjs on local without web server like MAMP but not Chrome? There is a Apache Server include in Mac OS ?

Here is a zip folder sample.

share|improve this question

closed as not a real question by Daniel Lawson Jul 14 '12 at 16:21

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

    
JavaScript and PHP are very different things. Also you are not giving a lot of background info on what you are trying to do and how you tried it. –  Gerry Jul 14 '12 at 16:14
    
You're asking a variety of loosely connected but not very clear questions in this post. I suspect you do have a question for this site, but it isn't answerable in its current form. Please edit your post to clarify what you want to accomplish, what you tried, what results you expected, and the results you got. Also, when you delete things from your post, just delete them; don't strikethrough. The site preserves previous versions of your posts, so you don't need to leave a record in the current version. –  Daniel Lawson Jul 14 '12 at 16:21
    
yes, sorry — may be it's a stack overflow question about Safari (or not a real question). –  benoît Jul 14 '12 at 16:37
add comment

2 Answers 2

PHP is a server-side programming language, it cannot be executed in the browser and needs to be interpreted by the server.

Apart from MAMP, you can also use the built-in Apache installation with OS X or a package manager like Homebrew or MacPorts to install a webserver with PHP support.

share|improve this answer
    
Thank you for this link! But I edit my post to be more specific, I see a js script work only on Safari or Chrome with MAMP, I am really curious to understand. –  benoît Jul 14 '12 at 16:09
add comment

I didn't know that Safari could execute PHP; the only way that I believe that it could do this is by using Mac OS X's built-in Apache server and placing the files in the "Sites" folder. You can activate this server by using Web Sharing in System Preferences.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.