Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Programming/Scripts

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 4th September 2011, 01:14
vampire vampire is offline
Junior Member
 
Join Date: Sep 2011
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Php-CGI compile as a static binary

Hello,

Do anyone know how I can compile php as a static binary?

My actual hosting have php 5.2.10 and it don't want do the upgrade to php53, I know that is possible compile php as a static binary, I have search on google but I don't find nothing that work.

Do you know any method for build an php-cgi binary with static library and run it in anyone servers?

Thanks you guys!
Reply With Quote
Sponsored Links
  #2  
Old 4th September 2011, 01:15
vampire vampire is offline
Junior Member
 
Join Date: Sep 2011
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have try that guide

http://www.tipcache.com/tip/Build_PH...binary_15.html

but don't works.
Reply With Quote
  #3  
Old 4th September 2011, 19:10
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

Do you get any errors?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #4  
Old 4th September 2011, 20:03
vampire vampire is offline
Junior Member
 
Join Date: Sep 2011
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes,

I try to compile php 5.3.3, I use this command

PHP Code:
./configure --enable-gd-native-ttf --enable-static=yes 
    
--disable-cli 
    
--with-config-file-path='/cgi-bin/' 
    
--prefix='/usr/local/php5cgi' 
    
--with-gd --with-mysql --with-mcrypt='/usr/lib' --with-mhash --with-curl='/usr/lib' 
    
--enable-ftp --with-openssl --enable-sockets 
    
--with-zlib --with-zlib-dir='/usr/include' 
    
--with-pear --enable-soap 
    
--with-imap --with-imap-ssl --with-kerberos 
    
--with-jpeg-dir='/usr/lib' --with-png-dir=/usr/lib --with-pdo-mysql --with-mysqli 
    
--enable-bcmath --enable-zip --with-freetype-dir='/usr/lib' 
    
--with-xsl --with-xmlrpc --with-libxml-dir='/usr/lib' --with-sqlite 
    
--with-pdo-sqlite --with-pcre-dir='/usr/lib' --with-bz2 --with-xpm-dir=/usr/lib 
PHP Code:
creating libtool
appending configuration tag 
"CXX" to libtool

Generating files
creating 
./config.status
creating php5
.spec
creating main
/build-defs.h
creating scripts
/phpize
creating scripts
/man1/phpize.1
creating scripts
/php-config
creating scripts
/man1/php-config.1
creating main
/php_config.h
creating main
/internal_functions.c
creating main
/internal_functions_cli.c
+--------------------------------------------------------------------+
License:                                                           |
This software is subject to the PHP Licenseavailable in this     |
distribution in the file LICENSE.  By continuing this installation |
processyou are bound by the terms of this license agreement.     |
| If 
you do not agree with the terms of this licenseyou must abort |
the installation process at this point.                            |
+--------------------------------------------------------------------+

Thank you for using PHP.

testing:~/php-5.3.3
And che configure it's ok, I edit the "Makefile" such as the guide, and the error is:

PHP Code:
/usr/bin/ldattempted static link of dynamic object `/usr/lib/libmcrypt.so'
collect2: ld returned 1 exit status
make: *** [sapi/cgi/php-cgi] Error 1 
The file it's ok

PHP Code:
testing:~/php-5.3.3# ls -la /usr/lib/libmcrypt.so
lrwxrwxrwx 1 root root 18 Sep  3 17:56 /usr/lib/libmcrypt.so -> libmcrypt.so.4.4.7 
Any solution?
Reply With Quote
  #5  
Old 4th September 2011, 20:08
vampire vampire is offline
Junior Member
 
Join Date: Sep 2011
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

The output of ld command is that

PHP Code:
testing:~/php-5.3.3# /usr/bin/ld /usr/lib/libmcrypt.so
/usr/bin/ldwarningcannot find entry symbol _startnot setting start address 
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cron errors guimnk General 1 5th April 2011 09:20
ISPConfig3 Debian Squeeze Crontab - Log petrichbg Installation/Configuration 5 22nd March 2011 12:25
Problem with services!! banzaiwebstudio.com Installation/Configuration 7 19th May 2010 21:13
Unable to install ISPConfig bdonecker Installation/Configuration 21 26th May 2009 08:20
Apache2 Freezes celtic Server Operation 31 28th May 2007 17:18


All times are GMT +2. The time now is 09:40.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.