Updating to PCRE 8.33 or Higher
This page is obsolete. It is being retained for archival purposes. It may document extensions or features that are obsolete and/or no longer supported. Do not rely on the information here being up-to-date. |
The extension Scribunto requires PCRE 8.33 or higher. PCRE 8.33 was released in May 2013. Thus this page is only relevant for ancient systems.
The process below describes how to update to PCRE 8.33 on an Ubuntu virtual server (instance) running on an Amazon AWS.
As of this date, the Ubuntu server will install PCRE 8.31. To update to 8.33 you will need to install a number of library packages necessary to compile new code. You will also need to know how to login as the root user.
If you don't want to compile things, Ondřej Surý's PHP PPA may also work.
Using PPA ondrej/php
Ondřej Surý happens to be the Debian maintainer for PHP, so this is a reasonably high-quality PPA.
As of January 2018, it carries PCRE 8.41. This worked to upgrade PCRE on Ubuntu 14.04.
Caution: This PPA installs a lot of other stuff if you let it. Keep an eye on what it installs, be prepared to revert if something goes wrong. But it'll probably be just fine.
Log In to Your Server
You will, of course, need to follow the Amazon AWS instructions for connecting with the server. One option is to download and install Git Bash and log-in to the server using your key.
If your Key.pem is in KeyDirectory those commands may look something like:
cd KeyDirectory
chmod 400 Key.pem
ssh -i "Key.pem" ubuntu@ec2-52-223-93-123.compute-1.amazonaws.com
If you successfully login, the prompt will show your path followed by $
Install Packages Needed to Compile PCRE 8.33
Do not try to go to the root directory to run the following commands. Run them from the default directory where your permissions are already set up right.
Cut and paste the following lines. They will all run in sequence. If there are any errors, you may need to run each install separately, as is done with the first three:
apt-get install build-essential
apt-get install checkinstall
apt-get install automake
apt-get install libbz2-1.0 libbz2-dev libbz2-ocaml libbz2-ocaml-dev
apt-get install libreadline-dev
Download PCRE 8.33 or Higher
You can search for the latest package address, which may be higher than 8.33. The steps below include the address for the package as of this date, Make any required changes for a different version or package
wget http://downloads.sourceforge.net/pcre/pcre-8.33.tar.gz
tar -xvzf pcre-8.33.tar.gz
If the package extracts properly, you will see all the new contents in the directory pcre-8.33. To see directories, type in the command line: ls
Now Compile and Check the Code for PCRE 8.33
cd pcre-8.33
./configure --prefix=/usr \
--docdir=/usr/share/doc/pcre-8.33 \
--enable-utf \
--enable-unicode-properties \
--enable-pcre16 \
--enable-pcre32 \
--enable-pcregrep-libz \
--enable-pcregrep-libbz2 \
--enable-pcretest-libreadline \
--disable-static &&
make
Now test the make, with the command:
make check
Now finish up the libraries with this command:
sudo make install
Sudo priviliges are required for the final make.
sudo make install
sudo mv -v /usr/lib/libpcre.so.* /lib
sudo ln -sfv ../../lib/$(readlink /usr/lib/libpcre.so) /usr/lib/libpcre.so
Then restart the server:
sudo service apache2 restart
Test it
pcretest -C
The above command should indicate how things are going.
Run the phpinfo.php page on your server (lookup how to make one, if you don't) and check what is listed for PCRE.
In my case, it still shows 8.31 installed, event though pcretest shows 8.33. Go figure! I don't know what to make of it at this time...nor can I tell if it is still causing problems with Scribunto.
But I hope this helps!
Login as Root User
According to this source, I made a mistake compiling as root user, since that messes up privileges. But I'm leaving this section to explain how to Login as Root User, just in case it helps someone.
- Enter the command: .
sudo passwd root
- This will prompt you to create a password for your root account. Make sure you don't forget it.
- Enter the command . You will be asked for your root password.
sudo -i
- Your prompt will change from $ to #, indicating you have root access.
- Enter the command to move to the root directory
cd ..
- Enter the command this should show you the directories and files in the root directory, including the new directory pcre-8.33
ls
NOTE: To disable root access, enter the command sudo passwd -dl root
Reference Pages
http://www.linuxfromscratch.org/blfs/view/7.4/general/pcre.html http://stackoverflow.com/questions/12212079/pcre-libraries-version-is-too-old