Previously, I used package managers (i.e. YUM) to install and configure PHP. However, I would like to upgrade to PHP 7 and the package manager(s) available do not yet have PHP 7 available natively.
The plan is to use Chef to compile PHP on the server (during Setup) from original source. With that said, this process can take ~15 minutes on our server and will severely impact boot time.
Are there any techniques for increasing the speed at which the PHP
is compiled?
Can I create a tarball of final binaries and simply
download these to my servers?
There are some online resources that suggest adding the "webtatic" repo to YUM to access PHP 7. Is this safe/secure + reliable?
I am looking for freedom to upgrade my PHP version independent of when the package manager supports the version I am interested in
We ended up waiting for Ubuntu 16.04 which brings in PHP 7 via apt-get. Compiling PHP from scratch didn't turn out to be an efficient nor maintainable process
Related
Good day,
We are currently running a fairly intensive system on PHP 5.5 connecting to a Redis database. The current setup has 6 Ubuntu 14.04 AWS instances dedicated to PHP and everything works fine. Due to some updated functionalities, we need to upgrade to PHP7 so I created a few Ubuntu 16.04 servers with PHP 7.0.28-0ubuntu0.16.04.1. We are using Predis (https://github.com/nrk/predis) to connect to the database but when I switch over to the 4 x PHP7 servers, I get random timeouts (not constant) - when these occur and because of the locking mechanism we have in place, the whole site becomes unresponsive for a few seconds.
So my question is mainly, has anyone ever got these issues? I think I have read some places that installing the phpredis extension helps, but that may have been a while back and I am not sure it's relevant here. Any insight on why I would need (or not) the extension would be useful.
I have copied the PHP settings from the old installation to the new one by comparing the INI and other configuration files but can post if needed.
I have freshly installed Ubuntu 12.04 and I have installed PHP as well. By default, it is installed with version 5.3.10 but my PHP project doesn't support PHP v5.3.10.
I want to downgrade PHP version to 5.2. How can I do it?
You would have to uninstall PHP and then reinstall an older version. However if your working on a project that your going to sell, or give to clients, or whatever the case my suggestion would be take out any functionality thats actually breaking between 5.2x and 5.3x and replace it with its new counter parts, as most people will not want to revert to older versions of PHP for any needs, and generally speaking php versions only goin in one direction, if you block yourself into 5.2 and your making software in one shape or another for people, what are you going to do next year when all the servers come stock with PHP 6? Not to mention a lot of hosted solutions try to provide the latest and greatest on there new machines, and will not revert for a single client especially on a shared hosting environment.
Anyway yea, back to your question again in your terminal under Ubuntu, you can try the following. sudo apt-get purge php5 which will then prompt you for a password, then proceed with removing PHP assuming you have the PHP package standalone and not bundled in with some preconfigured LAMP stack, but then again it should still work generally speaking so long as the version is right.
As for reinstalling it, remove purge from the command and use install. However you will need to look up the means of getting an archived version installed of PHP as apt-get will get you the latest
can someone in this universe give me the step by step to install PECL for windows on php server, so then i can use the SpiderMonkey js engine to run js within php code?
Unfortunately the pecl4win site lacks due to limited resources. Pierre, our windows build master, creates extensions randomly on request and makes them available via http://downloads.php.net/pierre/ until the new PECL infrastructure is ready.
If you need an extension not available there you might ask on the pecl-dev at lists.php.net mailing list.
Also http://wiki.php.net/internals/windows/stepbystepbuild has some instructions. The build system on windows currentlydoesn't allow building extensions stand-alone, but you have to build from the PHP source tree. For adding oauth you either have to put the sources under php-src/ext/oauth before running buildconf.bat or use the --extra-ext-dir (or similar) option for buildconf.bat.
After compiling PHP from source are the devel libraries still needed?
For example, I am building a newer version of PHP from source than is on our dev servers. I installed alot of [extension i.e. mysql, postgresql, curl, etc]-devel packages in order for the configure from the dev server setup to work. Do i still need these after php has compiled? For example could I make a distro and then distribute the PHP distro to another server without needing these devel dependencies?
I am a bit of a noob to this.
You don't need to ship the devel-libraries.
But my advice is to take some time and learn how the build system of your linux distribution works. And then build a new php package that can be installed by the package manager.
Take a look at how the "original" php packages were built for the distribution. Most likely you can simply copy and edit the existing rule file(s) and then make a new version of that package. This way you take advantage of the dependency mechanisms and the package manager will not remove/overwrite your version so easily when an update shows up in the "official" repositories.
What is the simplest way to install memcached on CentOS for someone new to the world of Linux? What is the best way to enable it for Apache and PHP
Unless Apache and PHP have some option to utilize memcached for internal workings (of which I am unaware of), you typically don't "enable" it for such apps. Instead, you would get a client library to use memcached from within your application, then start up memcached on whatever servers you want to provide memory with, then just use the client library API to store and retrieve cached data across multiple servers.
The easiest way is to find a reilable source of the RPM's needed to install memcached and memcached for PHP. There is a blog post which addresses this concern:
http://blog.gahooa.com/2009/02/08/update-on-fedora-vs-redhat-enterprise-linux/
We have been using EPEL (Extra Packages for Enterprise Linux) for exactly that on RedHat Enterprise 5.3. I believe it is a stated goal of EPEL to support Centos.
http://fedoraproject.org/wiki/EPEL
Essentially, it is a YUM repository which contains lots of extra packages from Fedora that were compiled for RHEL. Super easy to use.