Home

Who's Online

We have 9 guests online

Stats Visitor Details

United States United States
Unknown Unknown
Unknown Bot Unknown Bot
Your IP: 38.107.191.113

User Login

Social Bookmark

Facebook MySpace Twitter Digg Delicious Stumbleupon Google Bookmarks RSS Feed 

Save Page as PDF

Stats Counters


Visits today:26
Visits yesterday:30
Visits in this month:624
Visits in previous month:529
Visits in this year:1885
Visits in previous year:0
Visits total:1885
Max.daily visits:46
Day of max visits:2010-05-22
Max.monthly visits:624
Month of max visits:2010-07
Impressions today:1238
Impressions yesterday:1386
Impressions this month:31726
Impressions total:102319
Bots today:143
Date since:2010-04-14

Designed by:
SiteGround web hosting Joomla Templates
Linuxpro, Powered by Joomla! and designed by SiteGround web hosting
Gregory Machin
gregorymachin@linuxpro.co.nz
64 (211) 844347
Welcome to the Frontpage
PHP - custom php compile (Howto) PDF Print E-mail
Written by Administrator   
Thursday, 10 June 2010 17:16

This a howto on compiling php from source. This has been done many times before, so what's different, I have added more detail in the form of dependancies,tips, errors with fixes to try and simplify the process, and remove some of the common head aches.  As with all howto's you use it at your own risk.

Note this Howto was writen for Fedora 12 x68_64 but should apply to most Fedora installs.

Dependencies - depending on the functionality that you require the following may be needed.

rpm list :

re2c
bison
flex
lemon
patch
glib2-devel
gcc-c++
libtool ?
ibtool-ltdl-devel
httpd-devel
openssl-devel
mysql-devel
libxml2-devel
libcurl-devel
gdbm-devel
libjpeg-devel
libmcrypt-devel
libpng-devel
mhash-devel
pam-devel
postgresql-devel
mhash
sqlite-devel
unixODBC-devel
firebird-devel
freetds-devel
recode-devel
libicu-devel
enchant-devel
postgresql
postgresql-libs
zlib-devel
freetype
db4-devel-static
db4-devel
db4
zlib-devel
zziplib
zziplib-devel
bzip2-devel
bzip2-libs
epic**
gd
gd-devel
t1lib-devel
t1lib
gmp-devel
uw-imap-devel
ncurses-devel
aspell-devel
libedit-devel
mm-devel
net-snmp-devel
libtidy-devel
libxslt-devel

Tips:
1) If running 64 bit os use --with-libdir=lib64 the will resolve a lot of path dependency issues.
2) set the correct include paths in you php.ini
    ; UNIX: "/path1:/path2"
    include_path = ".:/php/includes; /opt/php-5.2.13/lib/php;"
3)Note if a recompile still gives errors after installing dependencies and fixing paths
   then start again on clean source as "make clean" does not remove all
   settings and  old compiles.
4)If your are having issues with debugging add " > debugging.log" to the end of the command you are exicuting to capture the output. eg: make > debugging.log

I typicaly download the current stable source from the php.net site / local mirror into a directory that I can use for the compile.

[root@www php-5.2.13]# wget http://nz.php.net/distributions/php-5.2.13.tar.gz

[root@www php-5.2.13]# tar -zxf php-5.2.13.tar.gz

[root@www php-5.2.13]# cd ./php-5.2.13

now I run configure with compile options to my requitements. You will note I'm installing php into the /opt/php-5.2.13 , this is because I run multiple installs of php, called as cgi.

[root@www php-5.2.13]#./configure \
--prefix='/opt/php-5.2.13' \
--exec-prefix='/opt/php-5.2.13' \
--with-config-file-path='/opt/php-5.2.13/etc' \
--with-libdir=lib64 \
--enable-cgi \
--enable-fastcgi \
--enable-discard-path \
--enable-force-cgi-redirect \
--enable-pcntl \
--enable-ftp \
--enable-magic-quotes \
--enable-sockets \
--enable-sysvsem \
--enable-sysvshm \
--enable-sysvmsg \
--enable-gd-native-ttf \
--enable-ucd-snmp-hack \
--enable-shmop \
--enable-calendar \
--enable-mbstring \
--enable-mbregex \
--enable-bcmath \
--enable-dba \
--enable-dom \
--enable-wddx \
--enable-soap \
--enable-json \
--enable-posix \
--enable-inline-optimization \
--enable-ctype \
--enable-pcntl \
--disable-rpath \
--with-libmbfl \
--enable-zip \
--with-bz2=shared \
--with-zlib \
--with-exec-dir \
--with-t1lib=shared \
--with-gettext=shared \
--with-gmp=shared \
--with-iconv=shared \
--with-pcre-regex \
--with-t1lib \
--with-layout=GNU \
--with-kerberos \
--with-imap \
--with-imap-ssl \
--with-snmp \
--with-xsl=sharedyip \
--with-libedit \
--with-pspell \
--with-mcrypt \
--with-mhash \
--with-tidy \
--with-ncurses \
--with-mm \
--with-readline \
--with-openssl \
--without-gdbm \
--with-curl \
--with-pear \
--with-mime-magic \
--with-db4 \
--with-regex=php \
--with-tidy \
--enable-ucd-snmp-hack \
--with-snmp=shared \
--enable-xml \
--enable-xmlreader \
--enable-xmlwriter \
--with-xmlrpc \
--with-pic \
--enable-exif \
--enable-gd-native-ttf \
--enable-gd-jis-conv \
--with-gd \
--with-jpeg-dir='/usr/lib64' \
--with-png-dir='/usr/lib64' \
--with-xpm-dir='/usr/lib64' \
--with-ttf=/usr/include/freetype2 \
--with-ldap \
--with-ldap-sasl \
--with-mysql=static \
--with-mysql-sock=/var/lib/mysql \
--with-mysqli=static \
--with-mysqli=/usr/bin/mysql_config \
--with-pgsql=shared \
--with-interbase=shared \
--with-mssql=shared

 

Next we want to compile the code.

[root@www php-5.2.13]# make

It is recomended to run make test but this can be skipped it takes ages......

[root@www php-5.2.13]# make test

Now we install the compiled binaries / files

[root@www php-5.2.13]# make install

I use the php.ini-recommended as the starting point for my php.ini. Depending on your compile options you may want to copy it to /etc , for my install I copy it to /opt/php-5.2.13/etc/

[root@www php-5.2.13]# cp php.ini-recommended /opt/php-5.2.13/etc/php.ini

Errors and fixes

./Configure errors

Error: Configure: error: xml2-config not found. Please check your libxml2 installation.
Fix: yum install libxml2-devel


Error: configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing.
      This should not happen. Check config.log for additional information.
Fix: yum install uw-imap-devel

Error: configure: error: Cannot find pspell
Fix: yum install aspell-devel

Error: configure: error: Please reinstall libedit - I cannot find readline.h
Fix: yum install libedit-devel

Error: configure: error: cannot find mm library
Fix: yum install mm-devel

Error: configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution
Fix: yum install libxslt-devel
 

Error:
configure: warning: bison versions supported for regeneration of the Zend/PHP parsers: 1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 (found: none).
configure: warning: flex versions supported for regeneration of the Zend/PHP parsers: 2.5.4  (found: )
configure: warning: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
configure: warning: lemon versions supported for regeneration of libsqlite parsers: 1.0 (found: none).
configure: warning: bison versions supported for regeneration of the Zend/PHP parsers: 1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 (found: none).

Fix: yum install bison bison flex lemon re2c

Make errors

To do

Last Updated on Tuesday, 15 June 2010 01:02
 
Samba - hide files from users PDF Print E-mail
Written by Administrator   
Thursday, 18 March 2010 22:51

There are 2 ways to Hide files from users.

One is to configure the share so that files with certain names or extensions are hidden, but if windows Explorer is set to show hidden file this will make them visible. To use this method add "hide files = /desktop.ini/*.bat/" to the share's configuration where you want it to be applied.

eg:

[everyone]
comment = everyone
path = /data/everyone
read only = no
hide files = /*.CR2/*.cr2/ #all files with the cr2 extension are hidden, unless hidden files are viewable in Explorer
guest ok = yes

Two is to configure the share so that the files are not visible at all via samba at all. Thus no matter who the user's work station is set they will never see the files. To use medod add  "veto files = /desktop.ini/*.bat/" to the share's configuration where you want it to be applied.

eg:

[everyone]
comment = everyone
path = /data/everyone
read only = no
hide files = /*.CR2/*.cr2/ #all files with the cr2 extension are non existent to Windows  Explorer
guest ok = yes

 

Last Updated on Thursday, 18 March 2010 22:54