Skip to main content

Tip: Recompiling PHP under linux

There is a problem if we install PHP from source, i.e: when we need to recompile due to a new version we should reapply the old configure parameter. Forgetting to enable some features often means break our web application which depends to the feature, however it is also hard memorizing what parameters we passed to the configure command as we do not often compiling the PHP. Fortunately, there is an easy way. Here it goes:



  1. Download the newest php source, here is the newest version (5.3.9) as I wrote this blog:
    http://www.php.net/get/php-5.3.9.tar.bz2/from/a/mirror

  2. Extract the php source:
    bambang@bambang-notebook:~/Downloads/php$ tar -xf php-5.3.9.tar.gz
    bambang@bambang-notebook:~/Downloads/php$ cd php-5.3.9
    bambang@bambang-notebook:~/Downloads/php/php-5.3.9$

  3. Write a phpinfo.php to your web server document folder. The content of the script:
    <html>
    <head>
    </head>
    <body>
    <?php echo phpinfo(); ?>
    </body>
    </html>

  4. Open the phpinfo.php above in your browser:

    Notice the configure command on the third row, block and copy the configure command

  5. Go back to your terminal in the step 2, and paste the command and press enter:
    bambang@bambang-notebook:~/Downloads/php/php-5.3.9$ './configure' '--with-apxs2=/usr/bin/apxs2' '--with-interbase=/opt/firebird' '--enable-sockets' '--with-pear' '--with-gd' '--with-mysql=/usr/bin/mysql_config' '--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd' '--enable-soap' '--enable-libxml' '--enable-calendar' '--with-pdo-firebird=/opt/firebird'

  6. After this step, you simply run make and sudo make install to upgrade your php.

Comments

Popular posts from this blog

Program timbangan elektronik, sebuah program Windows yang dijalankan di Linux.

Kemarin, mumpung hari libur aku setup program timbangan digital baru di kantor. Program yang lama merupakan program DOS yang aku tulis dengan menggunakan Clipper, program ini berjalan dengan baik di linux dengan bantuan dosemu. Program baru merupakan program Windows. Salah satu improvement dalam program ini adalah support untuk beberapa jenis indikator. Program diinstall di linux dengan wine versi 1.1.20. Beberapa catatan dalam instalasi program ini di wine: Pencetakan slip bukti timbangan dan laporan-2 menggunakan printer Dot Matrix. Apabila pencetakan dilakukan lewat printer driver, pencetakan dengan printer dot matrix akan menjadi sangat lambat plus hasil buruk plus boros pita... :) Oleh karena itu, program ini melakukan pencetakan langsung melalui printer port lpt1. Di windows, hal ini tidak menjadi suatu permasalahan, di linux dengan wine, maka lpt1 akan dimap ke /dev/lp0. Masalahnya, owner dari device ini adalah root dan group lp. Secara default user-user di Ubuntu (..nggak tahu...

Install Sketchup 2017 64 bits on Linux Ubuntu 16.04 64 bits

Install Sketchup 2017 64 bits on Linux Ubuntu 16.04 64 bits: 1.Enable 32 bit architecture: $sudo dpkg --add-architecture i386  2. Set wine PPA $sudo add-apt-repository ppa:wine/wine-builds Update repository $sudo apt-get update 3. Install wine newest staging branch version $sudo apt-get install --install-recommends winehq-staging 4. Ensure we get a 64bits wine, edit file ~/.profile and locate for text: export WINEARCH= If the value is win64 you are good, if the value is win32 change it to win64. Save the file. Ensure the environment variable also set to win64 by typing command: $export WINEARCH=win64 5. Download winetricks: $wget https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks    Don't forget to set the attribute so it is executable $chmod +x winetricks 6. Run winetricks $./winetricks Inside winetricks: Choose Select the default wineprefix, click OK Choose Install a Windows DLL or component, click O...

Menjalankan e-spt di linux.

Dirjen pajak belakangan ini mensosialisasikan e-spt yaitu program aplikasi komputer yang dipergunakan untuk pelaporan pajak (spt). Namun salah satu kendala besar bagi perusahaan-perusahaan menggunakan linux adalah bahwa program-program e-spt ini didesign hanya untuk komputer-komputer dengan O/S windows. Apakah kita harus mengorbankan sebuah komputer khusus plus o/s Windows hanya khusus untuk aplikasi e-spt ini? Untungnya, jawabannya adalah tidak, Wine (http://www.winehq.org) adalah sahabat anda. Bagaimana langkah-langkahnya? Install wine. Install komponen-komponen windows dengan bantuan winetricks Download dan install program e-spt Set format tanggal Wine sesuai dengan format tanggal Indonesia Detail langkah-langkah di atas adalah sbb: Install wine. Secara garis besar ada 2 cara untuk menginstall Wine: Install package binary Install dari source Cara paling mudah dan cepat adalah dengan menginstall package binary. Namun, metode ini mempunyai beberapa kelemahan: Package yang terinstall s...