Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

macos - how do i install php 5.4 on Mac OS X Lion?

I have downloaded php 5.4.0 from php.net and i want to upgrade it on mac os X lion.

I also want to ask if anyone knows how to upgrade apache.

Thanks in advance.


hi i have installed it but i don't know how to configure it with httpd.conf

 /usr/local/bin/php -v
PHP 5.4.0 (cli) (built: Mar  3 2012 02:41:24) 
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies

i tried to add this to httpd.conf

as it said but the web server doesn't want to start

LoadModule php5_module libexec/libphp5.so
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I've blogged about how to upgrade your local PHP installation to 5.4.

Archiving content incase of external site failure:

Now let’s upgrade PHP in a few steps:

1. Download and unpack the PHP source archive
2. Install following packages using brew: libjpeg and pcre
3. Change directory to the source archive of PHP
4. Use the configure command to prepare the compilation process:

./configure  
--prefix=/usr  
--mandir=/usr/share/man  
--infodir=/usr/share/info  
--sysconfdir=/private/etc  
--with-apxs2=/usr/sbin/apxs  
--enable-cli  
--with-config-file-path=/etc  
--with-libxml-dir=/usr  
--with-openssl=/usr  
--with-kerberos=/usr  
--with-zlib=/usr  
--enable-bcmath  
--with-bz2=/usr  
--enable-calendar  
--with-curl=/usr  
--enable-dba  
--enable-exif  
--enable-ftp  
--with-gd  
--enable-gd-native-ttf  
--with-icu-dir=/usr  
--with-iodbc=/usr  
--with-ldap=/usr  
--with-ldap-sasl=/usr  
--with-libedit=/usr  
--enable-mbstring  
--enable-mbregex  
--with-mysql=mysqlnd  
--with-mysqli=mysqlnd  
--without-pear  
--with-pdo-mysql=mysqlnd  
--with-mysql-sock=/var/mysql/mysql.sock  
--with-readline=/usr  
--enable-shmop  
--with-snmp=/usr  
--enable-soap  
--enable-sockets  
--enable-sysvmsg  
--enable-sysvsem  
--enable-sysvshm  
--with-tidy  
--enable-wddx  
--with-xmlrpc  
--with-iconv-dir=/usr  
--with-xsl=/usr  
--enable-zip  
--with-pcre-regex  
--with-pgsql=/usr  
--with-pdo-pgsql=/usr 
--with-freetype-dir=/usr/X11 
--with-jpeg-dir=/usr  
--with-png-dir=/usr/X11     

That’s it. After successful configuration use ‘make test’ to check your compilation and ‘sudo make install’ to actually install the new version.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...