Category Php

Integration Google Drive in PHP

Install Google APIs Client Library for PHP
for more info check https://github.com/googleapis/google-api-php-client

Authentication

SSL certificate problem: unable to get local issuer certificate

  1. Download this file: http://curl.haxx.se/ca/cacert.pem
  2. Place this file in the C:\wamp64\bin\php\php7.1.9 folder
  3. Open php.iniand find this line:

;curl.cainfo

Change it to:

curl.cainfo = "C:\wamp64\bin\php\php7.1.9\cacert.pem"

Make sure you remove the semicolon at the beginning of the line.

Save changes to php.ini, restart WampServer, and you’re good to go!

Increase phpmyadmin import file size

Go to wamp64\alias\ edit phpmyadmin.conf file then update size

Swagger with GET, POST and Multipart Upload file Example

SSL certificate error: unable to get local issuer certificate in curl

Add These Two line

in Laravel open vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php
and change this

to

Create Dynamic URLs from Database, like wordpress

if you have a script called index.php that took a parameter called slug…

You could then re-write requests using ...

Price Range Slider

Download

phpmyadmin not found

Create a link in /var/www like this:

sudo ln -s /usr/share/phpmyadmin /var/www/

Note: since 14.04 you may want to use /var/www/html/ instead of /var/www/

If that’s not working for you, you need to include PHPMyAdmin inside apache configuration.

Modifying the PHP Configuration php.ini

Modifying the PHP Configuration

The php.ini file can be edited to change the settings and configuration of how PHP functions. This section gives a few common examples.

Sometimes a PHP application might need to allow for larger upload files such as uploading themes and plugins on a WordPress site. To allow larger uploads for your PHP application, edit the php.ini file with the following command (Change the path and file to match your Loaded Configuration File. This example shows the path for Apache on Ubuntu 14.04.):

  • sudo nano /etc/php5/apache2/php.ini

The default lines that control the file size upload are:

php.ini
...

If Session is not working in VPS

The session support can be turned on automatically at the site level, or manually in each PHP page script: Turning on session support automatically at the site level we have to modify some setting in php.ini file. you can get php.ini file in folder you install PHP. To your sessions you have to set or reset following parameter in your php.ini file

Define path to save sessions
session.save_path = “C:\php\sessiondata\”

Directory related to server session should be under 777 chmod > fully writable

Whether to use cookies.
session.use_cookies = 1

Name of the session (used as cookie name).
session.name = PHPSESSID

Define Lifetime in seconds of cookie or, if 0, until browser is restarted.
session.cookie_lifetime = 0

;The path for which the cookie is valid.
session.cookie_path = /

The domain for w...