PHP Selber Bauen

Total Page:16

File Type:pdf, Size:1020Kb

PHP Selber Bauen PHPPHP selberselber bauenbauen PHPPHP UserUser GroupGroup FrankfurtFrankfurt 31.03.201131.03.2011 WalterWalter EbertEbert http://www.flickr.com/photos/zunami/4738471442/ Willkommen bei den anonymen PHPlern Mein Name ist Walter und ich kompiliere mir PHP selber Nicht immer, aber immer öfter Goggler-Handzeigen http://www.flickr.com/photos/zunami/3125589973/ http://php.net/releases/5_3_0.php http://www.php.net/releases/5_3_3.php http://derickrethans.nl/distributions-please-dont-cripple-php-or-red-hat-stop-fucking-around.html Kompatibilität / Features Du musst zum Beispiel: PHP4 irgendwer? ● eine alte PHP Version unterstützen ● mehrere PHP Versionen bzw. Konfigurationen testen ● proprietäre Extensions nutzen die nur mit bestimmten PHP Versionen funktionieren ● die letzte Entwickler-Version testen (trunk) http://www.flickr.com/photos/mama/94778673/ b ./configure make sudo make install http://www.php.net/downloads.php b ./configure make make test sudo make install Linux Unix Mac OS X Windows -> benutze einfach die binaries oder wenn man wirklich muss; besuche: http://wiki.php.net/internals/windows/stepbystepbuild b \ = escape linebreaks sudo apt-get install \ automake autoconf gcc \ libtool binutils subversion \ libxml2-dev libcurl4-dev \ libfreetype6-dev libjpeg-dev libpng-dev Packages fuer debian / ubuntu ./configure --help b sage: configure "options# "host# $ptions! [defaults in brackets after descriptions# %onfiguration! --cache-file&'()* cache test results in '()* --help print this message --no-create do not create output files --quiet, --silent do not print `checking.... messages --version print the version of autoconf that created con /irectory and file names: --prefix=01*'(2 install architecture-independent files in 01*' "/usr/local# --exec-prefix=*01*'(2 install architecture-dependent files in *01*'( "same as prefix# --bindir=/(1 user executables in /(1 [*01*'(2/bin# --sbindir&/(R system admin executables in /(1 "*01*'(2/sbin# --libexecdir&/(1 program executables in /(1 "*01*'(2/libexec# --datadir&/(R read-only architecture-independent data in /(1 "01*'(2/share] --sysconfdir&/(1 read-only single-machine data in /(1 "01*'(X/e --sharedstatedir&/(1 modifiable architecture-independent data in D( "01*'(2/com# --localstatedir&/(1 modifiable single-machine data in D(1 "01*'(2/ --libdir=/(1 object code libraries in /(1 [*01*'(2/lib# --includedir&/(1 % header files in /(1 "01*'(X/include# b ./configure \ --with-apxs2 \ --with-mysql=mysqlnd --with-mysqli=mysqlnd \ -–with-pdo-mysql=mysqlnd \ --with-curl \ --with-gd \ --with-jpeg-dir=/usr --with-png-dir=/usr \ --with-freetype-dir=/usr Fuer Apache: Sudo apt-get install apache2-prefork-dev b ./configure \ --enable-fpm \ --with-gettext --enable-zend-multibyte \ --enable-mbstring --with-mcrypt \ --enable-soap --enable-wddx --with-xsl \ --with-curl --with-openssl \ --with-zlib-dir=/usr --with-bz2 --enable-zip \ --with-gd --with-jpeg-dir=/usr \ --with-png-dir=/usr --with-freetype-dir=/usr \ --enable-exif \ --with-mysql=mysqlnd --with-mysqli=mysqlnd \ --with-pdo-mysql=mysqlnd \ --with-pgsql=/usr --with-pdo-pgsql \ --without-sqlite --without-sqlite3 \ --without-pdo-sqlite \ --with-mm=/usr ./configure ... b checking whether to build shared libraries... no checking whether to build static libraries... yes creating libtool appending configuration tag "CXX" to libtool Generating files updating cache ./config.cache 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.: creating sapi/cli/php.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 License, available in this | | distribution in the file )(%*@AE. By continuing this installation | | process, you are bound by the terms of this license agreement. | | If you do not agree with the terms of this license, you must abort | | the installation process at this point. | +--------------------------------------------------------------------+ Thank you for using PHP. b make /bin/sh /home/walter//ownloads/php-9.3.9/libtool --silent --preserve-dup-deps --mode&compile gcc -(ext/date/lib -(ext/date/ -(/home/walter//o3nloads/php-5.6.5/ext/date/ -/0?0;C>$D;(@% -(/home/walter//o3nloads/php-5.6.5/include ... lxml2 -lxml2 -lcrypt -lxml2 -lxml2 -lxml2 -lcrypt -o sapi/cli/php 8enerating phar.php 8enerating phar.phar 0*CR package 0?0;Crchive not installed: generated phar 3ill re+uire 0?0's phar extension be enabled. directorygraphiterator.inc directorytreeiterator.inc clicommand.inc invertedregexiterator.inc pharcommand.inc phar.inc Build complete. /on't forget to run .make test.. make test &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&b 0?0 ! /home/3alter//ownloads/php-9.3.9/sapi/cli/php 0?0;AC0I ! cli 0?0;E*1A($@ ! 5.6.9 F*@/;E*1A($@! 2.6.G 0?0;$A ! Linux - Linux )D- 2GG 2.6.69-25-generic H44-Ubuntu ADP (@( actual ! /home/3alter//ownloads/php-9.3.9/tmp-php.ini ... IC1@*/ >*A> A DDC1J --------------------------------------------------------------------- via [ext/pdo;sqlite/tests/common.phpt# AK)ite 0/$ %ommon! Bug #64660 Linserting streams as )$BsM"ext/pdo via [ext/s+lite/tests/pdo/common.phpt# AK)ite2 P/$ %ommon: Bug H6466G Linserting streams as L$BsM [ext/s Bug #6N866 Lfile;exists(M silently truncates after a null byteM [ext/ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& Jou may have found a problem in 0?0. Ie would like to send this report automatically to the 0?0 QC team, to give us a better understanding of ho3 the test cases are doing. (f you don.t 3ant to send it immediately, you can choose "s7 to save the report to a file that you can send us later. /o you want to send this report nowP "Jns#! sudo make install 8enerating phar.php b 8enerating phar.phar 0*CR package 0?0;Crchive not installed: generated phar 3ill directorygraphiterator.inc directorytreeiterator.inc clicommand.inc invertedregexiterator.inc pharcommand.inc phar.inc (nstalling 0?P AC0I module! fpm (nstalling 0?P %)( binary! /usr/local/bin/ ... (nstalling man pages! /usr/local/man/man1/ page! phpi5e.: page! php-config.1 (nstalling 0*C1 environment! /usr/local/lib/php/ "0*C1# Archive_>ar - installed: :.3.Q "0*C1# Console_8etopt - installed: :.2.6 "0*C1# Structures;Graph- installed: :.0.6 "0*C1# 2D); til - installed: :.2.: "0*C1# 0*C1 - installed: :.9.: Iarning! a 0*C1 user config file already exists from a previous Irote 0*C1 system config file at! /usr/local/etc/pear.conf Jou may want to add: /usr/local/lib/php to your php.ini include_path /home/3alter/Do3nloads/php-9.3.9/build/shtool install -c ext/phar/ph ln -s -f /usr/local/bin/phar.phar /usr/local/bin/phar (nstalling 0/O headers: /usr/local/include/php/ext/pdo/ b sudo cp php.ini-development /usr/local/lib/php.ini oder sudo cp php.ini-production /usr/local/lib/php.ini b Mit der neuesten Entwickler-Version Entweder: wget http://snaps.php.net/php-trunk-latest.tar.bz2 Oder: svn checkout http://svn.php.net/repository/php/php-src/trunk/ trunk cd trunk ./buildconf ./configure make sudo make install Standard aktivierte Extensions (in php 5.3) Core ctype date dom ereg fileinfo filter hash Iconv json libxml pcre PDO pdo_sqlite Phar posix Reflection session SimpleXML SPL SQLite sqlite3 standard tokenizer xml xmlreader xmlwriter ./configure --disable-simplexml --without-s+lite6 Populäre PHP Extensions ● APC, xCache, eAccelerator ● Memcache, memcached ● Xdebug ● PostgreSQL, mongoDB, OCI8, SQLSRV ● Sphinx, xapian, mnogosearch, solr ● Suhosin b PECL sudo pecl install apc http://pecl.php.net/ b Extensions kompilieren phpi5e ./configure make sudo make install Phpize gibt es ab php 5.3.6 auch fuer windows b /usr/local/lib/p$p.ini "apc# extension&apc.so "xdebug] 5end;extension&7/usr/local/lib/php /extensions/no-debug-non-5ts- 2GGNG626/xdebug.so7 http://de.php.net/manual/de/install.php Walter Ebert Web &evelopment @wltrd walterebert.de blog.walterebert.com slideshare.net/walterebert Search Meetup Frankfurt (12.4.) searchmeetupfrankfurt.de .
Recommended publications
  • File Operation Induced Unserialization Via the “Phar://” Stream Wrapper
    File Operation Induced Unserialization via the “phar://” Stream Wrapper Sam Thomas - @_s_n_t Contents Introduction ............................................................................................................................................ 2 Stream Wrappers .................................................................................................................................... 3 Phar Archives and the "phar://" Stream Wrapper ................................................................................. 4 Basic Attack Methodology ...................................................................................................................... 5 Identifying File Path Handling Vulnerabilities ......................................................................................... 6 The Phar File Format ............................................................................................................................... 7 Exploiting Induced Unserialization.......................................................................................................... 9 PHPGGC / PHARGGC ............................................................................................................................. 10 Case Studies .......................................................................................................................................... 11 Typo 3 ...............................................................................................................................................
    [Show full text]
  • An In-Depth Look at Streams
    Get Soaked An in-depth look at streams Davey Shafik Developer at EngineYard/Orchestra.io Author of Zend PHP 5 Certification Study Guide & Sitepoints PHP Anthology: 101 Essential Tips, Tricks & Hacks A long time contributor to PEAR, phpdoc; new contributor to internals, FCKEditor Original Contributor to Zend Framework Hard of hearing. Speak up! (Buy my books!) Stream Basics in 5 minutes PHP Streams Layer ALL Input/Ouput PHP Streams Layer Stream Filters Stream Stream Context Wrapper Stream Transport Input/Output Input/Output • include/require, and _once variants • fopen, fread, fgets, fgetcsv, fputcsv, fwrite, fclose, feof, etc • file_get_contents, file_put_contents, readfile, file • mkdir, rename, unlink Stream Filters [SUCK!] Stream filters [suck!] • Modify Data on-the-fly as it passes through the stream • Appended/Removed on-the-fly • To the top and bottom of the stack • Can be chained • Defaults: • string.* (useless) Stream Wrappers Stream Wrappers • Several Built-in by default • file:, http:, ftp:, data: (5.2+), glob: (5.3+) • With openssl extension: https:, ftps: • With zlib extension: zlib: • Special php:// stream Stream Transports Stream Transports • TCP • UTP • UNIX/UDG • + SSL, SSLv2, SSLv3 or TLS • HTTPS is TCP+SSL (1, 2, or 3) Stream Contexts Stream contexts • Provides Context (duh) to stream wrappers • Configuration (options) • Request Type (HEAD, POST, GET) • Login Credentials Using Streams <?php // Define our context options $options = array( // We use a nested array like: // $options['stream_wrapper']['option'] = 'value'; 'http' =>
    [Show full text]
  • Installing PHP and Libraries
    APPENDIX A Installing PHP and Libraries This book is aimed at programmers with at least some basic experience using PHP, so it is likely you already have access to a machine or two with PHP installed. However, many programmers use the versions already preinstalled in web hosting accounts or the default versions provided by package managers and so are unaware of how to compile, install, and tweak PHP and its ecosystem of extensions and libraries directly. Throughout this book you’ve looked at a number of extensions and libraries that provide functional programming structures and helper functions, and I’ve discussed features unique to PHP 7–like type declarations. Your web host or package manager may not have these extensions or versions available for automatic installation, so it’s good to know how to install them yourself. In this appendix, you’ll look at the various ways to change the PHP base upon which your programs are developed and run. Compiling and Installing PHP There are a dozen different ways to get PHP, including downloading and compiling it yourself, downloading precompiled binaries, using package managers and software repositories, and finding it preinstalled by a forward-thinking administrator. On most Linux distributions, PHP can be installed with a one-line command such as sudo apt- get install php or through graphical package managers such as the Synaptic Package Manager or the Ubuntu Software Center. Many common PHP extensions and add-ons are likewise available as prebuilt packages or alternatively available for easy
    [Show full text]
  • Compiling and Installing PHP, Extensions, and Libs
    APPENDIX A Compiling and Installing PHP, Extensions, and Libs There are a dozen ways to get PHP, including downloading and compiling it yourself, downloading precompiled binaries, using package managers and software repositories, and finding it preinstalled by a forward-thinking administrator. On most Linux distributions, PHP can be installed with a one-line command such as sudo apt-get install php5 or through graphical package managers such as the Synaptic Package Manager or the Ubuntu Software Center. Many common PHP extensions and add-ons are likewise available as prebuilt packages or alternatively through the PECL and PEAR systems. However, sometimes it becomes necessary to do a little more work to install PHP; for instance, in the following situations: • Your project has requirements for a specific version of PHP that is different from the one shipped with your OS. • You need extensions not available as packages. • You want to compile a customized version of PHP specific to your needs. Like anything involved in computers and software development, compiling PHP can take you down a rabbit hole of options, customizations, compatibility issues, libraries, and dependencies. A whole book could be written about the possibilities (and possible headaches) involved. Luckily for us, in most use cases, the basics of compiling a standard version are quite straightforward. And like most things in life, it gets easier after you have done it once. The following section outlines the steps necessary for getting, compiling, and installing PHP and its core extensions. PHP is written in C, and because you might not be familiar with the process of compiling C programs, I have explained each step to give you an idea of what is happening.
    [Show full text]
  • Software Packaging in 2012
    Software Packaging in 2012 International PHP Conference 2012 | October, 15th | Arne Blankerts Your Goal? » Share your code » Distribute a library or framework » Release an application » Deploy to a production or stage server » Deploy identically to many servers » ...? sharing experience Share your code » You do not need a packaging system » Use a version control system » Get a github.com account !" sharing experience Distribute a library or framework » #ear » http://pear.php.net » #yrus aka Pear& » http://pear2.php.net » Composer » http://getcomposer.org sharing experience Release an ap lication » #ear » #(# )rchive *#()R" » +S Level Packages » R#- » D./ » ... sharing experience De loy to a production or stage server » #ear » +S Level Packages » 01 sharing experience The choice is yours. And depends on your goal. PE%R » The Legacy Installer » #ackages come as tar.gz file » Package.xml for meta information » Limited Dependency management » 'an install depended #.)R packages » Informs on version / extension mismatches » #ackages are organized in 'hannels sharing experience PE%R - Pirum » ) #.AR Channel Server » http://pirum.sensiolabs.org% » http://github.com/fabpot/Pirum » 0nstalled via #.AR » pear channel-discover pear.pirum-project.org » pear installes pirum/Pirum sharing experience 'reating a pear package » Create a package.3ml » /uild package$ » pear package » )dd to prium$ » pirum add package.tgz sharing experience Pyrus / PEAR 2 » Rewritten #.AR Installer » Same package.3ml » Comes as phar » Seems to be pretty much a dead project
    [Show full text]
  • Phing User Guide
    < > Phing User Guide Michiel Rook <[email protected]> Ken Guest <[email protected]> Siad Ardroumli <[email protected]> Phing User Guide by Michiel Rook, Ken Guest, and Siad Ardroumli Phing 3.x Publication date 2021-09-07 07:19:44 Copyright © 2002-2020 The Phing Project Preface ................................................................................................................................... xvii 1. About this book ..................................................................................................................... 1 1.1. Contributors (present and past) ................................................................................... 1 1.2. Copyright .................................................................................................................... 1 1.3. License ....................................................................................................................... 1 1.4. DocBook ..................................................................................................................... 1 1.4.1. Building the documentation ............................................................................... 2 1.4.2. Template for new tasks .................................................................................... 4 1.4.3. Customization of the look & feel of the rendered outputs .................................... 4 1.4.4. DocBook v5 elements used in the manual and their meaning .............................. 5 2. Introduction .........................................................................................................................
    [Show full text]