Using eZ Publish on Mac OSX Lion - Full installation guide

Thursday 28 July 2011 1:17:37 am

By : Philippe VINCENT-ROYOL

Recently, Apple release a new Mac OSX version named Lion. There are a lot of new stuff, but for this tutorial, we'll see some updates for Apache and Php version. Macport will not be necessary to configure your AMP service.

This article is available in french at http://www.pheelit.fr/HighTech/Developpement/Installation-Apache-PHP-Mysql-sur-Mac-OS-X-Lion 

Apache

You could check your apache version typing :

httpd -v

Edit /etc/apache2/httpd.conf. (You need probably to use root rights). Find line 

LoadModule php5_module libexec/apache2/libphp5.so

and check that # is correctly remove. Same for the line 

Include /private/etc/apache2/extra/httpd-userdir.conf 

(this ll enable custom directory outside your www folder)

Save and restart apache service :

sudo apachectl restart

With your favorite browser check http://localhost  if you obtain "It's work" message.

I decide to change User and Group for Apache on http.conf file with my current login and staff group :)

 

MySQL

Download from http://dev.mysql.com/downloads/mysql , Mac OS X ver. 10.6 (x86, 64-bit), DMG Archive.

Installation order is really simple :

  • mysql5.5.xxx
  • MySQLstartupitem
  • MySQLPrefPane

To run MySQL, go to System Settings and you ll have a new prefpane named MySQL. Just open it and clic on start server.

Check if MySQL run properly :

/usr/local/mysql/bin/mysql -v

Just a tip is, edit your ~/.bash_profile and add

export PATH="/usr/local/mysql/bin:$PATH"

Reload bash profile via

source ~/.bash_profile

and try 

mysql -v

Last step with MySQL is to secure installation. Just type :

sudo mysql_secure_installation

phpMyAdmin

First step download it from http://www.phpmyadmin.net/home_page/downloads.php, and extract it on ~/Sites

Type,

sudo mkdir /var/mysql
sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock

to prevent error code 2000, then

mkdir ~/Sites/phpmyadmin/config
chmod o+w ~/Sites/phpmyadmin/config

With your browser run http://localhost/~username/phpmyadmin/setup/ . Click on button "new server" then "Authentication" tab and fll "Password for config auth" field. Save twice : one on this page and one on the other page. Try your config on page http://localhost/~username/phpmyadmin/

 

Install mcrypt library

Mcrypt isn't install by default on Mac OS X Lion, you need to do it. So download libmcrypt on http://sourceforge.net/project/showfiles.php?group_id=87941 . 

You need to download php source file. Normally you have php version 5.3.6. So download it from http://us.php.net/get/php-5.3.6.tar.gz/from/a/mirror 

You need to have Xcode 4.1 to compile source code. You could download it from free on Mac App Store.

Note : i moved and extract files on /usr/local/src/

Unzip files and place yourself on libmcrypt folder. Run command line :

MACOSX_DEPLOYMENT_TARGET=10.7 CFLAGS='-O3 -fno-common -arch i386 -arch x86_64' LDFLAGS='-O3 -arch i386 -arch x86_64' CXXFLAGS='-O3 -fno-common -arch i386 -arch x86_64' ./configure --disable-dependency-tracking
make -j6
sudo make install

Run command line on php-5.3.6/ext/mcrypt

/usr/bin/phpize
MACOSX_DEPLOYMENT_TARGET=10.7 CFLAGS='-O3 -fno-common -arch i386 -arch x86_64' LDFLAGS='-O3 -arch i386 -arch x86_64' CXXFLAGS='-O3 -fno-common -arch i386 -arch x86_64' ./configure --with-php-config=/Developer/SDKs/MacOSX10.7.sdk/usr/bin/php-config
make -j6
sudo make install

PHP

If php file not exists : 

sudo cp /etc/php.ini.default /etc/php.ini

Some modification to do on this file :

memory_limit = 256M
display_errors = On
html_errors = On
enable_dl = On

Don't remove semicolon on ;extension_dir = "./"

Add extension=mcrypt.so 

And check your phpinfo page if you see correctly mcrypt library.

 

XDebug

Apple already installed xdebug. So to enable it just remove semicolon on line: 

;zend_extension="/usr/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so"

on /etc/php.ini file.

 

PEAR

For unknown reasons, Apple has not installed it by default. To fix this problem, go on  /usr/lib/php and type

sudo php install-pear-nozlib.phar

edit your php.ini and replace line ;include_path = ".:/php/includes" by include_path = ".:/usr/lib/php/pear"

Update pear

sudo pear channel-update pear.php.net
sudo pecl channel-update pecl.php.net
sudo pear upgrade-all

now you could install phpunits, zeta components, etc :)

 

Virtual Host

Just edit /etc/apapche2/httpd.conf and in end on file add

NameVirtualHost *:80
 Include /private/etc/apache2/other/*.conf

Just create your vhost on /private/etc/apache2/other/

That's all :)

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 02:09:07
Script start
Timing: Jan 18 2025 02:09:07
Module start 'layout'
Timing: Jan 18 2025 02:09:07
Module start 'content'
Timing: Jan 18 2025 02:09:08
Module end 'content'
Timing: Jan 18 2025 02:09:08
Script end

Main resources:

Total runtime0.1699 sec
Peak memory usage6,144.0000 KB
Database Queries44

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0085 588.2109152.6563
Module start 'layout' 0.00850.0083 740.867239.5000
Module start 'content' 0.01690.1515 780.3672416.3594
Module end 'content' 0.16840.0014 1,196.726619.7031
Script end 0.1698  1,216.4297 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00744.3764150.0005
Check MTime0.00170.9873150.0001
Mysql Total
Database connection0.00060.365110.0006
Mysqli_queries0.068840.4880440.0016
Looping result0.00030.1861420.0000
Template Total0.106462.720.0532
Template load0.00321.873220.0016
Template processing0.103360.782720.0516
Template load and register function0.00010.047210.0001
states
state_id_array0.00422.494910.0042
state_identifier_array0.00140.843020.0007
Override
Cache load0.00281.6523990.0000
Sytem overhead
Fetch class attribute name0.00231.339330.0008
class_abstraction
Instantiating content class attribute0.00000.004630.0000
General
dbfile0.00060.3785100.0001
String conversion0.00000.005940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplblog_entry/full.tplextension/community_design/design/suncana/override/templates/blog_entry/full.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/header.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/header.tplEdit templateOverride template
30content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
19content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
10content/datatype/view/ezxmltags/strong.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/strong.tplEdit templateOverride template
5content/datatype/view/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.tplEdit templateOverride template
1content/datatype/view/ezxmltags/li.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/li.tplEdit templateOverride template
1content/datatype/view/ezxmltags/ul.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/ul.tplEdit templateOverride template
1content/datatype/view/ezkeyword.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezkeyword.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 79
 Number of unique templates used: 11

Time used to render debug report: 0.0001 secs