Category: "Documentation / Instructions"

AMI - upgrade PHP from 7.1 to 7.3

AMI - upgrade PHP from 7.1 to 7.3
PHP logo

Don't do this on a production system

I ran this on an Amazon Linux AMI - it's probably fine on CentOS, etc.

Get all the PHP 7.1 packages and make a file called php. You might have to change the .x86_64 to .i386/.i686

sudo yum list installed php71* | grep php | cut -f1 -d' ' | tr -d '.x86_64' | tr "\n" ' ' | sed "s/71/73/g" > php

Remove PHP 7.1 (remember I said not to do this on a production machine)

sudo yum remove php71*

Now edit your php file and add

sudo yum install at the beginning of the list of packages

It should look something like this

sudo yum install php73 php73-cli php73-common php73-gd php73-imap php73-intl php73-json php73-mbstring php73-mysqlnd php73-opcache php73-pdo php73-pecl-apcu php73-pecl-igbinary php73-pecl-memcached php73-pgsql php73-process php73-soap php73-ml

Run the php file with

source php

And, if you are using memcached, run this too

sudo yum install php7-pear php73-devel
sudo pecl7 install memcached
sudo pecl7 update-channels

Add this into php.ini somewhere ...

extension=memcached.so

Restart Apache

sudo apachectl restart

Bask in the glory

Fast Page Added

This is a faster version of robots.design. There are no demo connections, and the interface is simpler.

The remainder of the code is the same.

eZ publish sitestyle color mapping

robots.design was used on the eZ publish Website Interface to recolor the CSS.

Steps

  1. Copied a static version of the eZ Web Interface files. The demonstration does not require a full installation of eZ.
  2. Made a backup of the .css files
  3. Used the first set of sed commands, but didn’t like the results
  4. Used the second set of sed commands
  5. Tinted bg.jpg, the background image, with Jasc Paint Shop Pro
  6. Changed background color of body to white
  7. Changed background color of usermenu to light brown

Observations

  • The design relies heavily on images. This is a disadvantage when using robots.design, because it can be difficult to recolor the images. It is important to remember the objective of robots.design is to replace the mechanical task of updating the CSS, it can’t redesign the images site. The tool is intended to help a person reskin or redesign the site. This link: http://www.wirehopper.com/eZ/eZ_files/images/images.htm lists the images, with their dimensions, to help a designer select those that should be updated.
  • There are eight CSS files. In this case, robots.design allowed them to be modified very quickly and accurately. Adjustments were made manually (steps 5 and 6 above) using Firebug to identify the CSS file.
  • The impact of robots.design can be subtle. It does a good job recoloring the CSS, and it is easy to forget how long it can take to the same work manually, and without missing anything. For a large eZ publish site, with many content classes, this can be tremendous timesaver.

Conclusion

Prior to choosing robots.design as a design tool for eZ webin, it would be better to create a greyscale version of the eZ web interface images. This would allow the images to support a wide range of colors. Another option would be to develop a custom skin.

Opportunities

A very real possibility would be to integrate a tool similar to robots.design into eZ. It is a simple, mechanical substitution process, the image processing software required is usually installed on the server with eZ, and it is an extremely cost-effective way to update the CSS files. It would fit well under the design settings.

robots.design(tm) - Code Architecture

robots.design™ is a hosted tool, because it can be, and it makes it accessible to everyone.

By reading an image, and extracting the colors from CSS files, then generating sed commands, the design is changed in an extremely efficient manner. There are also shell commands that will find the images, either in a directory or in a CSS file, then display them in a browser, so you can simply create new images, with the same dimensions, with the same names and copy them to complete the transition.

This is also an example of how the whole LAMP stack can be used to reduce the amount of code that has to be written.

Key elements:

  • ImageMagick is used for the image processing
  • sed handles all substitution. It could have been done with PHP, but sed is already there. The commands displayed are run on the CSS files for the blog - exactly as displayed
  • Two open source components were also used to handle the color coding and analysis. They are identified in the credits area
  • Providing shell commands gives the user complete control. They can be adjusted to better fit the requirements

The one hesitation people may have about the tool is that they must submit an image. There are several ways the images can be protected. One option is to use software to extract the image colors and paste them into the textbox on the page, in the correct syntax. Another solution would be to create an image with the colors, but no identifying text or images, or use a piece of the image that has the colors. The images are deleted immediately after the colors are extracted, they are not analyzed, viewed, stored or collected in any way.

The code isn’t offered for download for several reasons:

  • It isn’t distribution quality code, it is a utility and the code reflects that. The PHP is interspersed with the HTML, and the CSS is in the same document.
  • It relies on components from other sources (which are given credit), so distribution would either have to include those components or provide instructions to go get them and install them
  • Thus far, the level of interest has not justified a significant investment beyond what has been done

The project began as an investigation to find a cost-effective way to change the colors of an existing design without manually recoding it. This solution meets that requirement.

Image substitution

Image substitution has been added. This allows you to extract the images, and view them and their dimensions. You can then create new images with the same names to change the design.

1 2