-1

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.

3
  • 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
    Commented Jul 14, 2012 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
    Commented Jul 14, 2012 at 16:21
  • yes, sorry — may be it's a stack overflow question about Safari (or not a real question).
    – benoît
    Commented Jul 14, 2012 at 16:37

2 Answers 2

1

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.

1
  • 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
    Commented Jul 14, 2012 at 16:09
1

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.

0

Not the answer you're looking for? Browse other questions tagged .