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

/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 ...


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)


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 ...


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 ...


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 ...


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

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 ...


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 ...


3

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' ...


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 ...


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

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

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

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

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) ...


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 ...


1

Firstly, you should be sure why you would like to do this and what a fresh environment would provide. This is going to be a bit tedious to do since you have multiple sources for the installs. For homebrew, follow the steps in this answer to uninstall homebrew. For MacPorts, follow the steps from the uninstall MacPorts page page. For PHP and Apache, it may ...


1

I'm assuming that the deployment/install script was put at /usr/local/packager/packager.py when it was installed. Apparently, you can use this script to list the packages that are installed: /usr/local/packager/packager.py list Unfortunately, the script that you used to install PHP doesn't appear to have an uninstall feature. However, you should be able ...


1

Have you modified the post_max_size too ? post_max_size = 20M upload_max_filesize = 20M Check "PHP post_max_size overrides upload_max_filesize" here : http://stackoverflow.com/questions/7754133/php-post-max-size-overrides-upload-max-filesize


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

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

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      ...


1

After messing around for a while a found something that worked for me: # backup original php.ini sudo mv /usr/bin/php /usr/bin/php.bkp # create a symlink from MAMP's php.ini in /usr/bin directory # (I use 5.2, change the path for 5.3) sudo ln -s /Applications/MAMP/bin/php/php5.2.17/bin/php /usr/bin/php There!


1

Rather than running the bundled Apache installation, which gives you limited or obscure configuration options, I suggest that you instead install the free MAMP (Macintosh, Apache, Mysql and PHP) package. It's better and more useful as a development environment, because it is designed as as a PHP development environment for Mac, and will save you much time ...


1

i dont think its that easy with default apache, not without the risk of it reverting on a software update, the config files would be in /etc/apache2 though its probably simpler and more reliable to install something like macports and install apache2 from there, that way it will be persistent of apple software updates and much more flexible in configuration


1

If you build the iPhone toolchain in you local environment, you can compile PHP locally and then move it to iOS. http://stackoverflow.com/questions/4001510/compile-php-with-gd-for-iphone-os-4-1 http://george.insideiphone.com/index.php/iphone-toolchain/ http://code.google.com/p/iphone-dev/ http://www.sj99.com/toolchain.html I've not done this, but I'm ...



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