Page 1 of 1

10.8 OS X and WIN Apache Php HTDOCS common setup and sharing

Posted: Sat Nov 24, 2012 6:44 pm
by darknkreepy3#
10.8 apache setup by kristoffe
11-24-2012
08-23-2013

JUMP DOWN TO SEE HOW TO SETUP MAC SIDE

Introduction
os x 10.8.x mountain lion is full of mistakes, errors, omissions, and other nonsense making it clear that apple is trying to subversively phase out its web creation and content modification in it's user operating system os x 10.8 ml.

Apache server is built in still but hidden by the operating system for normal users, and you can just simply enable it in system preferences. With a few command line (terminal) commands you can get it up and running. But this is still not enough as it is setup very crappily.

Some 3rd party software does a great job helping those who hate the command line (terminal) like http://secrets.blacktree.com and their Secrets.prefPane. Download it, unzip it, and just doble click the pref icon (gear and an S) and you will then be able to:

Finder: Show hidden files

on and off, no terminal commands. But if you want to learn those terminal commands, here they are:

[show hidden files]
TERMINAL >

Code: Select all

defaults write com.apple.Finder AppleShowAllFiles YES
[hide hidden files]
TERMINAL >

Code: Select all

defaults write com.apple.Finder AppleShowAllFiles NO
SIMPLE APACHE AND PHP SETUP TO SHARE WITH A WIN OS INSTALL ON SAME PC
SHARING WITH OS X AND WIN HTDOCS FOLDER
NOT USING PER USER APACHE CONF BUT SYSTEM WIDE SETUP (much better)

Code: Select all

10.8 apache php setup parallel and shared with win|osx(10.8)
08-23-2013 by kristoffe brodeur. c2013 All Rights Reserved.

/*---------------*/
/* APACHE 2.2.22 */

[terminal]
sudo apachectl start
	[enter password]

[terminal]	
httpd -v
	[version of apache, 2.2.22 in 10.8 by default]


Apache Root shared with Windows

	win			d:/htdocs/
	osx			/Volumes/d_data-465gb/htdocs
	
[finder]
finder->go->go to folder...	
/etc/apache2

[httpd.conf]
right click->open with->TextWrangler

	edit file[enter password]
	
	[change]
	DocumentRoot "/Library/WebServer/Documents"
		[to]
		DocumentRoot "/Volumes/d_data-465gb/htdocs"
		
	[change]
	<Directory "/Library/WebServer/Documents">
		[to]
		<Directory "/Volumes/d_data-465gb/htdocs">
		
	save file[enter password]	
	

[terminal]		
sudo apachectl restart
	[enter password]

[www browser]
http://127.0.0.1/

/*------------*/
/* PHP 5.3.15 */

[finder]
finder->go->go to folder...	
/etc/apache2

[httpd.conf]
right click->open with->TextWrangler

	edit file[enter password]
	
	[change]
	#LoadModule php5_module libexec/apache2/libphp5.so
		[to]
		LoadModule php5_module libexec/apache2/libphp5.so
		
[terminal]		
sudo apachectl restart
	[enter password]

[www browser]
http://127.0.0.1/

/*------------------*/
/*PHP modifications */

[finder]
finder->go->go to folder...	
/etc/

[php.ini.default]
	copy and make a duplicate [php.ini.default 2][enter password][add extension][enter password]
		rename to [php.ini]
			edit [php.ini]
				restart apache
				
[change]
upload_max_filesize = 2M
	[to]
	upload_max_filesize = 8M

[change]
max_file_uploads = 20
	[to]
	max_file_uploads = 100

remove the (;)semicolon and activate all of these modules (pc|mac)

extension=php_curl.dll
extension=php_fileinfo.dll
extension=php_gd2.dll
extension=php_gettext.dll
extension=php_mbstring.dll
extension=php_mysql.dll
extension=php_mysqli.dll
extension=php_pdo_mysql.dll

(cant find this in os x 10.8 php.ini, to fix add etc later)
	extension=php_xmlrpc.dll

save->restart apache->test with www browser (127.0.0.1)