I was trying to cache the frequently used urls in the redis so that the website loads faster. But when I was trying to implement the redis cache got caught with following error. class Redis not found Fix: Issue was with php7.x-redis not installed and in this case I was using php7.2. apt install php7.2-redis
Category: PHP
Japanese character were displaying blank in pdf file converted using wkhtmltopdf
We can convert the html file to pdf format using tool called wkhtmltopdf. I have already provided necessary steps to implement in linux server in my previous post. But the pdf file was not displaying Japanese characters in it. Fix Please note that Chinese, Japanese, Korean font was not installed in the server. yum install … Continue reading Japanese character were displaying blank in pdf file converted using wkhtmltopdf
script to test website response time
We can simply test the website response time using the following script from the linux command line. curl -s -w 'Testing Website Response Time for :%{url_effective}\n\nLookup Time:\t\t%{time_namelookup}\nConnect Time:\t\t%{time_connect}\nAppCon Time:\t\t%{time_appconnect}\nRedirect Time:\t\t%{time_redirect}\nPre-transfer Time:\t%{time_pretransfer}\nStart-transfer Time:\t%{time_starttransfer}\n\nTotal Time:\t\t%{time_total}\n' -o /dev/null https://www.domain.com
install package “wkhtmltopdf” to convert html to pdf
1. Install the wkhtmltopdf package # wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox-0.12.6-1.centos7.x86_64.rpm 2. check version # wkhtmltopdf -V 3. Now link the binary file' # ln -s /usr/local/bin/wkhtmltopdf /usr/bin/wkhtmltopdf 3. To test whether the html is converted to pdf # /usr/local/bin/wkhtmltopdf http://www.google.com google.pdf Loading pages (1/6) Counting pages (2/6) Resolving links (4/6) Loading headers and footers (5/6) Printing pages … Continue reading install package “wkhtmltopdf” to convert html to pdf
Whoops, looks like something went wrong – laravel website issue
While trying to migrate laravel to production environment, following error was getting generated while accessing the website through browser. Whoops, looks like something went wrong Whoops, looks like something went wrong The issue was with application key was not generated. For that run the command under public_html to generate a key php artisan key:generate … Continue reading Whoops, looks like something went wrong – laravel website issue
Fatal error: Uncaught Error: Class ‘DOMDocument’
A Magento website was down with following error. Fatal error: Uncaught Error: Class 'DOMDocument' not found in /home/bunnytech/public_html/vendor/magento/framework/Config/Dom.php:390 Stack trace: #0 /home/bunnytech/public_html/vendor/magento/framework/Config/Dom.php(117): Magento\Framework\Config\Dom->_initDom('<?xml version="...') The issue was that php xml module was not installed/enabled. "DOM/XML" should be in enabled state while accessing the php info page.
phpMyadmin : session_start(): open(SESSION_FILE, O_RDWR) failed: No such file or directory (2)
While accessing phpMyAdmin the following error was popping up Error during session start; please check your PHP and/or webserver log file and configure your PHP installation properly. Also ensure that cookies are enabled in your browser. session_start(): open(SESSION_FILE, O_RDWR) failed: No such file or directory (2) session_start(): Failed to read session data: files (path: ) … Continue reading phpMyadmin : session_start(): open(SESSION_FILE, O_RDWR) failed: No such file or directory (2)
How to change time zone for a domain using .htaccess
Open your .htaccess file and add the following line: SetEnv TZ location where location is the specific timezone you want to define. A list of Supported Timezones can be found here: http://www.php.net/manual/en/timezones.php
funny characters appearing for .htm file
The sites with the .htm pages were loading with funny characters. Fix Removed the php parsing for .htm file in /usr/local/apache/conf/php.conf
configure: error: Unable to detect ICU prefix or no failed. Please verify ICU install prefix and make sure icu-config works.
During PHP compilation following error was getting generated. configure: error: Unable to detect ICU prefix or no failed. Please verify ICU install prefix and make sure icu-config works. Fix yum install libicu-devel