ALL
Install and enable redis extension in PHP 5.X on Windows
Redis is frequently used as a caching layer for web applications to improve its performance. In PHP 5.x, if one wants to use Redis, the redis extension needs to be installed and enabled first.This post will show how to install and enable redis extension on Windows with PHP 5.X. Basically there are two dlls to be downloaded: php_redis.dll and php_igbinary.dll.Below are detailed stepsGo to http://windows.php.net/downloads/pecl/releases/redis/2.2.7/ and find the respective php_redis zip matching your environment.Go to windows.php.net - /downloads/pecl/releases/igbinary/2.0.1/ and f...
Free PHP, HTML, CSS, JavaScript editor - Codelobster IDE
In this article, we suggest you to get acquainted with the free editor of web languages - Codelobster IDE. It is presented on the software market for a long time already, and it wins a lot of fans.Codelobster IDE allows you to edit PHP, HTML, CSS and JavaScript files, it highlights the syntax and gives hints for tags, functions and their parameters. This editor easily deals with those files that contain a mixed content.If you insert PHP code in your HTML template, then the editor correctly highlights both HTML tags and PHP functions. The same applies to CSS and JavaScript code, which is contai...
1,356 0 CODELOBSTER IDE PHP HTML
An experience on fixing HTTP 406 Not Acceptable error
This post is about an experience of mine on fixing a HTTP 406 Not Acceptable error seen on one of my page.Just got back from a business trip and opened my computer as usual to start to monitor my website statistics. But when I opened the page on showing real time page views, it shows nothing but zero. So I pressed F12 to bring up the developer tool to check on what's going on. The logic of loading the real time page view is backed by AJAX call. In the developer tool console, I see that the rAJAX request gets HTTP 406 Not Acceptable error. And in the network tab, see similar result.This confuse...
10,499 1 HTML AJAX HTTP 406 PHP CONTENT-TYPE
PHP to integrate with Sign in with Google
Google has a huge user base and hence it provides an authentication service for third party service to integrate with them so that people can sign in with Google in their services. Google also adopts OAuth 2 to provide this kind of Open ID connect service.This post will introduce how to integrate with sign in with Google functionality in your PHP website. Create a client app on GoogleThe first step you should follow is to create a Google app, you can follow the post here to create the project. Once the project is created, you will get a client id and client secret, these will be used late...
4,406 0 OPEN API GOOGLE API SIGN IN WITH GOOGLE PHP
Send email using PHPMailer on GoDaddy hosting
According to PHPMailer troubleshooting guide, GoDaddy has a very strict rule on sending email using PHPMailer.Popular US hosting provider GoDaddy imposes very strict (to the point of becoming almost useless) constraints on sending an email. They block outbound SMTP to ports 25, 465 and 587 to all servers except their own. This problem is the subject of many frustrating questions on Stack Overflow. If you find your script works on your local machine, but not when you upload it to GoDaddy, this will be what's happening to you. The solution is extremely poorly documented by GoDaddy: you ...
Resolve high CPU usage issue caused by file_get_contents in PHP
Sometimes a Linux server which runs Nginx + PHP-CGI(php-fpm) web service may experience sudden system load increase and the CPU usage is around 100% for many php-cgi processes when checking with top command. If this happens, file_get_contents may be the cause if it's used in the PHP script.In lots of web applications, normally there are lots of API requests based on HTTP. Many PHP developers like to use file_get_contents("http://example.com/") to get the API response because it's simple to use. But the problem of using file_get_contents is that it will block if the remote server responds ...
12,504 0 PHP FILE_GET_CONTENTS PHP-CGI
5 Lightweight PHP Frameworks For Creating An API
PHP is undoubtedly one of the most popular programming languages that offer a wide range of lightweight frameworks for building basic websites to REST APIs. These frameworks are powerful tools that have the potential to enhance productivity in order to deliver faster results without getting distracted from the best practices of development.Developing REST APIs with plain PHP is a tedious and time-consuming process. In order to sort this out, you only need to hire php developers who have a niche expertise in the micro-frameworks of PHP as they have the capacity to make the process of building R...
The confusing strtotime() function in PHP
Frequently PHP programmers get confused of the use of i month, -1 month, next month in strtotime() function. and hence it leaves some impression to programmer that this function is not that reliable.Let's take one example of strtotime call with -1 month and see why it leaves this impression.date("Y-m-d",strtotime("-1 month")) // Assume today is 2018-07-31What's the output of above call? The answer is 2018-07-01. Why not 2018-06-30? So people get confused. It appears that this is wrong at first glance, but if think again, this output is reasonable.Below is how the logic worksIt first...
10,923 0 STRTOTIME PHP FIRST DAY OF -1 MONTH