Tagged: php

macOS Sierra Errors and Fixes

Updating to a new OS has always been a pain for any OS. Mac is no different. A couple of days ago, updated the mac OS from OS X El Capitan (10.11) to macOS Sierra (10.12).

screen-shot-2016-10-26-at-6-25-45-pm

Mostly the update seemed okay. However, I did receive a few hiccups after the recent update. Here’s the list of errors that I received and how I solved it. Hope it helps someone else who come across similar error/s.

php config files

Sierra simply takes a backup of the previous /etc/php.ini into /etc/php.ini-previous and doesn’t install the new php.ini by itself. So, make sure you copy the new php.ini.

The same applies to /etc/php-fpm.conf file too.

locale settings – zsh

I use zsh as my primary shell. Not sure what went wrong with the default locale settings. I get somewhat similar error messages related to locale whenever I connect to a CentOS or Debian based servers via SSH.

To fix it, I appended the following line into ~/.zshrc

export LANG="en_US.UTF-8"
export LC_ALL=$LANG

Just for the records, here’s the error message on CentOS 5…

-bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = “UTF-8”,
LANG = “en_US.UTF-8”
are supported and installed on your system.
perl: warning: Falling back to the standard locale (“C”).
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = “UTF-8”,
LANG = “en_US.UTF-8”
are supported and installed on your system.
perl: warning: Falling back to the standard locale (“C”).
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = “UTF-8”,
LANG = “en_US.UTF-8”
are supported and installed on your system.
perl: warning: Falling back to the standard locale (“C”).

Even though, the error message contains the word “bash”, it isn’t related to bash. ūüėõ

ZSH – du – tab completion

Actually, an old issue has been fixed in macOS Sierra. Earlier, there was a bug that doesn’t allow tab completion for the command “du”. Now it works! YES!!! Thanks for whoever fixed it!

I will keep this post updated, if I come across any more errors and possible fixes!

Advertisements

systemctl automatically restart service

References:

  1. Ensure systemd services restart on failure by Jon Archer
  2. php-fpm systemd unit with auto-restart by Juan Luis Boya García
  3. systemd Project Web Page

systemd is a system and service manager that runs as PID 1 and starts the rest of the system and services. The main command used to introspect and control systemd is systemctl.

Basically do the following to let a service restart automatically…

  • Edit /lib/systemd/system/name.service file
  • Insert “Restart=on-failure” under the section “Service”. Save the file
  • Execute the command… systemctl daemon-reload
  • Execute the command… systemctl restart name_of_the_service
  • (optional) try killing the process now

See https://wiki.archlinux.org/index.php/Systemd#Examples for more examples.

PhpMyAdmin Disable Warning: Your PHP MySQL library version differs from your MySQL server version – This may cause unpredictable behavior

Short answer: http://docs.phpmyadmin.net/en/latest/config.html#cfg_ServerLibraryDifference_DisableWarning

For those who still can’t understand…

Open up your PhpMyAdmin’s config.inc.php file and then add the following line in it…

$cfg['ServerLibraryDifference_DisableWarning'] = true;

Now, log out and then log in to PhpMyAdmin. Do you still see the warning?