Tag Info

Hot answers tagged

15

Edit /private/etc/apache2/httpd.conf Find the line that says LoadModule php5_module libexec/apache2/libphp5.so and uncomment it by editing out the # at the beginning of the line. (Then save the file, obviously.) Go to Terminal and type sudo apachectl graceful at the console:


10

I'd say unified GUI integration. With MAMP, you've got a single window to manage Apache, PHP, and MySQL. Whereas with the built-in stack, you have to active PHP manually and have another interface for MySQL (with no easy way to turn it on or off)


10

/etc/php.ini.default serves only as a reference and is not read out by PHP at all. The built-in PHP installation will look for the file /etc/php.ini instead. This file is not present by default, but you can copy /etc/php.ini.default to /etc/php.ini and make your modifications in there. You could also just create an empty file and only add any directives you ...


5

Apache is the process that needs to have appropriate permissions to access /var/www. Apache is typically user _www of group _www on MacOS. Verify this with: grep -e '^Group\|^User' /etc/apache2/httpd.conf Two lines should be printed. My output looks like: User _www Group _www This means that on my system, Apache processes run as user _www with ...


5

php -i from the command line; $ php -i phpinfo() PHP Version => 5.3.3 System => Darwin jsalaz-mac.local 10.6.0 Darwin Kernel Version 10.6.0: Wed Nov 10 18:13:17 PST 2010; root:xnu-1504.9.26~3/RELEASE_I386 i386 Build Date => Aug 22 2010 19:27:08 Configure Command => '/var/tmp/apache_mod_php/apache_mod_php-53.3.1~2/php/configure' ...


5

The disadvantage is that you're installing stuff that you already have installed. This can cause problems when - for example - you want to use PHP using the command-line. This will trigger the built-in PHP version by default instead of the one bundled with MAMP. If these are different the results can be unexpected. I would recommend using the default OSX ...


4

Actually, the #1 advantage to using MAMP is tremendous: Each time you upgrade your system, your environment won't break! There were a couple of Snow Leopard updates (or maybe it was Leopard to Snow Leopard, I can't remember) that broke Mysql. One was by moving the mysql.socket file. There was another update the broke PHP. In both cases I had to hunt around ...


4

From http://drupal.org/node/66187 (drupal may be irrelevant for your needs, but their site had a good explanaton - wanted to source it for you, and give credit to them) By default, MAMP has the memory limit that a script can use set at 8MB, which is the PHP default. Looking at PHP's php.ini-recommended file, this memory limit is normally set at 128MB. To ...


4

As has been pointed out already, unless you are specifically forwarding http traffic from your router to your machine, your locally hosted stuff will only be available to you and the other computers on your local network. To answer your question on restricting access to your webserver to just your machine. You can do this a couple of ways. Remember, ...


4

Instead of guessing which php.ini you need to alter, run this command to locate the file: php -r 'phpinfo();' | grep 'php.ini' Even though I use MAMP PRO, by default my command-line PHP commands are not executed using their copy of PHP. In my case it says the file is found at /etc/php.ini Once you have located the file, follow the instructions on all of ...


3

There really isn't a good reason to run your web server as root. It opens you up to all kinds of potential abuse. OS X defaults to running the service as a severely under privileged user to protect you. Don't make these changes unless you're absolutely certain you know what you're doing! The httpd.conf file for the default Apache2 installation that comes ...


3

I strongly suggest you use the package installer or use a full stack of configuration options when compiling, including the --prefix option so you know where the binary gets installed to. I can only guess PHP 5.4 installed itself into /usr/local/bin or somewhere else and didn't just overwrite the default binary in /usr/bin. And you seem to have not modified ...


3

Briefly; no there is no easy way to update them. (Assuming that compiling from source is not considered easy) I would strongly caution against modifying the system installed versions as you're likely to have your updated versions broken when Apple issues an update that updates them. (Usually Security Updates and has bitten some users/sysadmins when Perl has ...


2

Yes, this should be possible using Automator. I haven't worked with php from the command line, so I'm unsure exactly how that works, but this is a general instruction. Open Automator (It's in the Applications folder). Choose to create an Application. Select Utilities under Library and choose Run Shell Script and drag it to the area on the right. In the ...


2

It seems as you did not add the new path to your $PATH. Citing the FAQ of the website that you have posted: Why does php -v on the command line still show my old version? php-osx doesn't overwrite the php binaries installed by Apple, but installs everyting in /usr/local/php5. The new php binary is therefore in /usr/local/php5/bin/php. You can ...


2

For me, I did the following: Edit the /Applications/MAMP/conf/php5.4.4/php.ini and php.ini.temp to be: memory_limit = 128M ; Maximum amount of memory a script may consume (8MB) Then in finder simply make the php.ini and php.ini.temp read only for all users. This way, MAMP cannot overwrite it with default files. Restart the server and check your ...


2

You can do what you ask, but it requires a Mailbox > Rebuild operation. That asks Mail to scan the ~/Library/Mail directory you found and rebuild its email header database from the files it finds there. I doubt you'd find that acceptable. I'm afraid Gerry's comment above is the right way to go about this: set up a test email account somewhere, use one of ...


2

Yes, Apache and PHP already come by default with a Mac OS X installation, and you can download an installer for MySQL on their website. For a configuration guide, have a look at this related answer: How to turn Mac OS X Lion into a web server? The linked answer also applies to Mac OS X Snow Leopard. Another popular (and imo superior) way of running ...


2

Not sure if you solved this, but you need to make sure the PEAR Mail extension is installed. Open your Terminal and enter: pear install Mail


2

To show installed php extensions from port, try port installed | grep php53- or instead of port list.


2

On OS X you'll have following : The base PATH used is located in /etc/paths. It is used to set $PATH. By default, the file contains : /usr/bin /bin /usr/sbin /sbin /usr/local/bin It will also load the paths located in /etc/path.d/. When opening the terminal I will load : ~/.bash_profile ~/.bash_login, (if .bash_profile doesn't exist) ...


1

If you have the latest version of MAMP it should be fine. MAMP 2.1.1 is compatible with Mountain Lion, although if you have any issues it's pretty easy to reinstall.


1

Have you tried installing it via Homebrew? Also just found a blog post (you have to scroll down a bit to the Homebrew section) which is saying that the problem with compiling PHP might be because ML doesn't come with X11, but there's a workaround. Actually, here's the relevant bit from the blog post: Apple removed support for X11 in Mountain Lion. This ...


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

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.


1

Try to chmod 755 the folder and all of its parent folders.


1

There should be a /etc/php.ini.default file that you can copy to php.ini.


1

You could have a look at MAMP (there's a free and commercial version) MAMP is installed in the typical Mac fashion: very easily. MAMP will not compromise any existing Apache installation already running with your OS X. You can install Apache, PHP and MySQL without starting a script or having to change any configuration files! Philosophy: MAMP was ...


1

There are a few, but my favourite is Zend's own, fully integrated hassle free controller Zend Server Community Edition


1

I personally prefer using Web Sharing and installing only MySQL Server, just to stick with the Mac OS X Apache setup. Web sharing has support for PHP, all you need to do is remove the comment (#) from the following line of the file /etc/apache2/httpd.conf: #LoadModule php5_module      libexec/apache2/libphp5. So it becomes: LoadModule php5_module      ...



Only top voted, non community-wiki answers of a minimum length are eligible