PHP

Discover what PHP can do.

operator not supported for strings slider_markup_init.php [SOLVED]

This error comes from an older version of the   WordPress LayerSlider plugin after an upgrade to PHP 7. In case you are unable to upgrade your LayerSlider plugin, or do not wish to,  here is a patch to fix the issue. Don’t worry it’s pretty easy.  : ) How to resolve error: operator not supported… Read more operator not supported for strings slider_markup_init.php [SOLVED]

Resolve Website Issues After PHP upgrade 2017 [SOLVED]

Site Issues after upgrading PHP After upgrading to PHP 7, you may notice that your site is having issues. For example on a WordPress site, certain plugins will be disabled and you will see messages stating that certain PHP modules are missing. eg. requires the function mb_detect_encoding to import and export CSV files …currently has… Read more Resolve Website Issues After PHP upgrade 2017 [SOLVED]

PHP: Dynamically refer to an object property

Sometimes you may need to programmatically determine which property of an object you would like to call. Are you trying to dynamically refer to an object property? In order to do this, you need to get past an issue with ambiguity. The PHP documentations says: …if you write$$a[1] then the parser needs to know if you… Read more PHP: Dynamically refer to an object property

PHP Find php.ini and edit configuration settings from command line

Manipulating the PHP ini file from the command line is really quite straight forward. To get yourself started on the command line, just ask PHP for help like this:

You’ll see a list of options and arguments. From the php help output one can see that the -i option will show what amounts to the… Read more PHP Find php.ini and edit configuration settings from command line

PHP What is Opcode Cache and When to Use it

Are you wondering: What is Opcode Cache and When to Use it? I just read an excellent article entitled PHP Performance I: Everything You Need To Know About OpCode Caches published by Engine Yard. The article is a transcript of a video on PHP opcode cache, actually. Engine Yard goes into just enough detail, allowing… Read more PHP What is Opcode Cache and When to Use it

How to Configure a Custom php.ini file for a Website

There are a few ways to create a custom php.ini configuration directives for an apache website. Create a phpinfo.php file with the following content within your document root.

View this file in your browser and look near the top for which Server API is running PHP. If PHP is being run by CGI If the phpinfo.php… Read more How to Configure a Custom php.ini file for a Website

How to Add Current URL from Within Symfony2 Controller

I am building a REST app and wanted to include the resources “href” with every response. Being able to easily do this from with a Symfony2 Controller is very convenient. Here’s the code:

Hope this helped you find it fast!

Drupal Role Specific Development Feedback

On rare occasions you may have to work on a production site and need some development feedback. If you want to control which role sees your output, this snippet can help. With this logic in place, only appropriate roles will see your working on the site.

Drupal Display PHP Errors on One Domain of Multi Site

When using a multi-site setup, You may want errors only to appear for one site. In that case, use $_SERVER[‘HTTP_HOST’] in an if statement to only display PHP error messages for the domain of your choice: