Idiots Guide to Installing PHP


Recommended Posts

If you have hosting with Dreamhost or any other host which gives you a shell account, you can install your own custom version of PHP. I needed to compile PHP with GMP support for the OpenID login plugin for WordPress, so I spent the whole day tweaking trying to get everything working. There's a page on Dreamhost's Wiki which has a script, but it still took me hours to get right. I've written a quick guide to help avoid the mistakes which slowed me down.

  1. The first thing you need to do is download Putty and set it up to connect to your host.
  2. We're going to create a few shell scripts to install PHP and all the other packages it requires. It's probably easiest to make your edits in notepad or another text editor, then copy and paste them into Putty by right-clicking. If you just create the files then upload them, there tend to be problems with line breaks and the script doesn't work.
  3. Start by downloading the preparation script and the installation script. Open them with a text edtitor and change the line export DOMAIN="yourdomainhere.com" to match the domain you're installing the CGI script on. This should be the directory the domain is served from. Eg: If your site serves files from /home/someone/xyz.com, use xyz.com. The version information may need updating, because I won't be updating this script.
  4. The first script we need to set up will download the different packages and extract them. Once you're done editing, hit CTRL+A in your text editor, then copy everything to your clipboard. Create a new file by typing nano php_prep.sh at the command prompt.
  5. Paste the contents of your clipboard into the new file by right clicking in Putty, then hit CTRL+O to save the file, then CTRL+X to exit nano.
  6. In *nix you need to make files excutable before you can run them. Do this by typing chmod +x php_prep.sh
  7. Now we need to set up the script which does the installing. Create a new file by typing nano php_inst.sh at the prompt, then copy and paste the contents of your edited php_inst.sh file by right clicking the terminal. Hit CTRL+O, Return, then CTRL+X to save and exit.
  8. Make the file executable by typing chmod +x php_inst.sh
  9. Now that everything's set up, we can run the first script by typing ./php_prep.sh at the prompt. It might take a while but if there are no errors you should eventually see "Done downloading and unpacking prerequisites".
  10. Run the installation script using ./php_inst.sh . This might take a while to complete, so start solitaire or something.
  11. When everything's finished, you should see "INSTALL COMPLETE!" and have a shiny new custom version of PHP installed.
  12. If you don't already have one, create a .htaccess file at the root of your domain. You can do this by typing nano .htaccess. Add the following lines:
    	  Options +ExecCGI
    	  AddHandler php-cgi .php
    	  Action php-cgi /cgi-bin/php.cgi


  13. That should be it. If there were no errors, you can test your installation by viewing a PHP file on your site. Hopefully you'll either see no change, but it's possible you'll see a load of errors.

I'm not an expert with Linux, but I'll try to help with any problems people may run in to.

I also posted this article on my blog, which has loads of other technical How-Tos and tutorials.

Link to comment
https://www.neowin.net/forum/topic/615690-idiots-guide-to-installing-php/
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Camtasia 2026.1.3 by Razvan Serea TechSmith Camtasia is the complete professional solution for high-quality screen recording, video editing and sharing. Camtasia 2026 makes editing your videos easier, and faster than ever. The new editor is packed with enhanced video processing, all-new production technology, an innovative library, and stock videos and other creative assets to help you create more polished, professional videos. No video experience needed. Anyone can create informative, engaging videos. Create professional, eye-catching videos: Add special video effects - Apply Behaviors that are perfectly designed to animate your text, images, or icons. Get a crisp, polished look without being a professional video editor. Drag-and-drop your edits - What you see is what you get. Every effect and element in your video can be dropped and edited directly in the preview window. And you can edit at resolutions up to beautiful 4K, for clear video at any size. Get exceptional performance - Camtasia takes full advantage of your computer’s processor with 64-bit performance. You’ll get fast rendering times and enhanced stability—even on your most complex projects. Camtasia 2026.1.3 changelog: Feature Updates Improved keyboard navigability in tool panels. Improved screen reader accessibility of headings in Preferences. Tool panels can now be resized using a keyboard-navigable control. Updated color of folder icon in User Library tab for better visibility. Grouped media now render a composite waveform considering all audio media within that group. Added Long Path Aware to the manifest of Editor and Recorder. Performance Improvements Improved performance for editing groups on the timeline. Improved the project loading performance when timeline has lots of trec media with cursor data. Updates for IT Administrators Updated cpp-httplib from 0.38.0 to 0.43.3. Updated expat from 2.7.4 to 2.8.0. Updated freetype from 2.13.3 to 2.14.3. Updated harfbuzz from 13.0.1 to 14.2.0. Updated libpng16 from 1.6.55 to 1.6.58. Updated pango from 1.57.0 to 1.57.1. Updated girepository from 2.86.3 to 2.88.0. Updated pcre2-posix from 10.47.0 to 12.0.2. Added new harfbuzz-gpu.dll. Updated FFmpeg from 7.1.1 to 7.1.2. Updated aom from 3.11.0 to 3.13.1. Updated dav1d from 1.5.0 to 1.5.1. Updated ogg from 1.3.5 to 1.3.6. Updated SDL2 from 2.32.4 to 2.32.10. Updated zlib from 1.3.1 to 1.3.2. Updated Nalpeiron binaries to version 4.4.69.3. Bug Fixes Fixed an issue which prevented some user submitted crash reports from being sent. Fixed a potential memory leak when decoding HEVC or VP9 video. Fixed a potential crash when trying to delete a range selection on a magnetic track. Fixed a bug with the Properties Panel showing stale properties when only a caption is selected on the timeline. Fixed an issue that could prevent the Opacity and Blur properties from being changed in the Background Removal effect. Fixed an issue where larger Camtasia online projects may fail to open in Camtasia Editor. Table of contents thumbnails are no longer created for Smart Player exports with no table of contents. Fix resetting skew revert to revert just skew and not scale as well. Fixed editing in Snagit with snagX file with Unicode characters. Fixed a bug where grouped visual media could be cropped in some cases. Fixed importing SnagX files with Unicode characters. Localization fixes. Download: Camtasia 2026.1.3 | 309.0 MB (Shareware) View: Camtasia Homepage | Tutorials | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • yeah it seems to be Edge only. The dialog buttons work as expected in Chrome and Firefox. The phone is using Android 16 (OneUI 8.5) and Edge version  149.0.4022.53
    • I'm not aware of this issue, but to help the other guys.  What version of Android are you using? Did you try a different browser? To see if Edge is the issue here.
    • I agree when are you going to read this (really poor BTW) article? Here is a better article so you actually know what is going on and answers questions you had in other comments --> https://arstechnica.com/gadgets/2026/05/speed-boosting-low-latency-profile-is-one-of-the-improvements-coming-to-windows-11/ It is unclear if one will be able to disable the new profile at this point but I am not seeing any reason why one would.
  • Recent Achievements

    • One Month Later
      Jamswaz earned a badge
      One Month Later
    • Week One Done
      Jamswaz earned a badge
      Week One Done
    • Rookie
      Marzoid went up a rank
      Rookie
    • Community Regular
      coch went up a rank
      Community Regular
    • One Year In
      slackerzz earned a badge
      One Year In
  • Popular Contributors

    1. 1
      +primortal
      510
    2. 2
      PsYcHoKiLLa
      188
    3. 3
      +Edouard
      156
    4. 4
      Steven P.
      83
    5. 5
      ATLien_0
      75
  • Tell a friend

    Love Neowin? Tell a friend!