PHP Configurations

 PHP Configurations

Sometimes we need to allow the php script to run for maximum time.

Here we have some useful settings but it is not recommended to use on the production server. 

ini_set("max_execution_time",0); 

    It will allow max time of script execution.

ini_set("max_input_time",-1);

    It will allow max input time.

ini_set("memory_limit",-1);
    
    It will allow max memory limit.


Visual Studio Code User and Workspace Settings

 Visual Studio Code gives us two different scopes for development settings.

  1. User Settings - Global Settings for Visual Studio Code
  2. Workspace Settings - Workspace Settings stored inside your workspace



User Settings in Visual Studio Code


User Settings Path:

Windows: %APPDATA%\Code\User\settings.json








For a complete list of settings take a look at

https://vscode.readthedocs.io/en/latest/getstarted/settings/

Placeholder Services Supported

To use placeholder images in an application or project we have the following list of services available.

  1. DummyImage.com
  2. Fake Images Please
  3. LoremFlickr
  4. LoremPixel
  5. Pipsum
  6. Placehold.it
  7. Placekitten
  8. Placeskull
  9. Unsplash

1. DummyImage.com

We can give height, width, foreground color, and background color in url

Examples:
https://dummyimage.com/600x400/000/fff
https://dummyimage.com/300
https://dummyimage.com/640x4:3
https://dummyimage.com/16:9x1080


Link:  https://dummyimage.com/

2. Fake Images Please

Simple put image sizes after url.

For example:

<img src="https://fakeimg.pl/250x100/ff0000/">
 <img src="https://fakeimg.pl/350x200/ff0000/000">

https://fakeimg.pl/

How to change Directories and Files Permissions in Linux

We can change Directories and Files Permissions in Linux by running the following commands.


Command to change folder path to 755:

find /base_path/public_html -type d -exec chmod 755 {} \;

Command to change file path to 644:

find /base_path/public_html/* -type f -exec chmod 644 {} \;


For Example:

find /path/to/server/public_html -type d -exec chmod 755 {} \;

find /path/to/server/public_html/* -type f -exec chmod 644 {} \;


 


Visual Studio Code Common And Best Development Extensions

There are allot of Visual studio code extensions are out there but most of the time I use following

extensions.

 

1. PRETTIER – CODE FORMATTER
Best Code formatting extension.


https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode

2. PATH INTELLISENCE
Extension autocompletes file path without any issue.

https://marketplace.visualstudio.com/items?itemName=christian-kohler.path-intellisense

3. BRACKET PAIR COLORIZER

Extension for colorizing matching brackets.

https://marketplace.visualstudio.com/items?itemName=CoenraadS.bracket-pair-colorizer

4. JAVASCRIPT (ES6) CODE SNIPPETS

Code snippets for JavaScript in ES6 syntax

https://marketplace.visualstudio.com/items?itemName=xabikos.JavaScriptSnippets

5. Tab Nine Extension

TabNine Autocomplete AI

https://marketplace.visualstudio.com/items?itemName=TabNine.tabnine-vscode

6. Auto Rename Tag

If we rename the starting tag then the ending tag will get the update automatically.

https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-rename-tag

7. Code Spell Checker

Check the spelling of code and highlight the wrong spelling.

https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker

Nano Linux Command Line Text Editor

 Nano is a Linux Command Line Text Editor.


Install Nano on CentOS and Fedora

sudo yum install nano

Composer file could not be downloaded: failed to open stream: HTTP request failed!

 Error

[Composer\Downloader\TransportException]
The "http://packagist.org/p/symfony/class-loader$78539d95ddac0cc02514ed9cdf1515023dcd289b4f7e03ed948e868a1b02acf2.json" file could not be downloaded: failed to open stream: HTTP request failed!

The error means the composer is unable to process the request due to HTTP and we need to update

and add https instead of http.


Solution:

In your composer.json update following 

"repositories": [
    {
        "packagist": false
    },
    {
        "type": "composer",
        "url": "https://packagist.org/"
    }
],

Solution:2

Run this command to set https globally on the system.


composer config --global repos.packagist composer https://repo.packagist.org




Updated on 23/8/2020