Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 PHP


  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...

5,017 4       PHP 5.6 WINDOWS REDIS PHP


  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,045 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 ...

15,314 2       PHP PHPMAILER GODADDY


  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 ...

11,848 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...

3,459 0       PHP API


  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...

9,619 0       STRTOTIME PHP FIRST DAY OF -1 MONTH


  Install both 32 bit and 64 bit WAMP server

WAMP server is a platform tool for serving PHP applications on Windows. It includes a combination of Apache, MySQL and PHP service which can help developers test or run PHP applications with minimal setup.Sometimes one would first have a 32 bit version of WAMP installed and a few applications have been configured. But later s/he would mistakenly installed a 64 bit version of WAMP and somehow the 32 bit version configuration is overwritten. This causes a problem where the old applications configured for 32 bit WAMP will not function any more even if the 32 bit version of WAMP server is started....

12,309 0       PHP WAMP 64 BIT 32 BIT MULTIPLE VERSION


  Sending message to Slack Incoming Webhook using PHP

Slack is a popular work collaboration tool and it provides many features which help teams collaborate. It has one function which allows sending messages to channels from external source such as your own web service -- Incoming Webhook. This is extremely useful when want to monitor something and get notified when some event occurs and it doesn't require complicated setup.To send messages using Incoming Webhook, a service URL has to be generated on Slack and then the message can be posted to this URL and it will be posted on your team channel. After clicking "Add Configuration", the process...

25,717 0       PHP CURL SLACK INCOMING WEBHOOK