Skip to content

Instantly share code, notes, and snippets.

View danilobatistaqueiroz's full-sized avatar

Danilo Batista de Queiroz danilobatistaqueiroz

View GitHub Profile

Debugging Php7 Code

To debug Php code, it's necessary to activate an extension on the Php server. And a client plugin in an editor like Notepad++ or Atom.


Installing xdebug library to debug Php version 7.

@danilobatistaqueiroz
danilobatistaqueiroz / configuring_ssl_on_apache2.md
Last active January 29, 2020 19:03
configuring ssl on apache2

Configuring SSL on Apache2

Note
A self-signed SSL certificate is easy and free, but triggers an error in most modern browsers reporting that the connection is not private.
Let’s Encrypt offers browser trusted, free SSL certificates, but does not support Extended Validation (EV) or multi-domain (wildcard) certificates.
An Extended Validation Certificate (EV) is a certificate conforming to X.509 that proves the legal entity of the owner and is signed by a Certificate Authority key that can issue EV certificates.
To gain those features, a commercial SSL certificate must be used.

Generating the private key and the certificate (Self-Signed)

@danilobatistaqueiroz
danilobatistaqueiroz / rewrite_subfolders.md
Last active November 6, 2017 02:24
Rewrite urls on subdirectories on apache

Rewriting Urls on Apache2

Supose you have a directory structure like that:

directories

and on httpd.conf you have:

DocumentRoot c:\www

@danilobatistaqueiroz
danilobatistaqueiroz / mariadb_without_admin_rights.md
Last active July 3, 2023 01:48
mariadb standalone without admin rights
@danilobatistaqueiroz
danilobatistaqueiroz / debug_php_with_brackets.md
Created October 26, 2017 19:31
debugging php code with brackets

Find if the installed PHP is threadsafe or nonthreadsafe

Open a phpinfo() and search for the line Thread safety. For a thread-safe build you should find enable.

You can also use:

On Windows : php -i|findstr "Thread"

On Linux: php -i|grep Thread

@danilobatistaqueiroz
danilobatistaqueiroz / configuring_phpunit.md
Last active November 24, 2017 00:30
configuring phpunit

Configuring phpunit

to use phpunit you can download the phpunit.phar:

phpunit.phar file

After downloading, copy phpunit.phar file into a folder

(you can download in a folder that is mapped on %PATH% environment variable, or in the project folder)

@danilobatistaqueiroz
danilobatistaqueiroz / starting_with_mockery.md
Last active November 29, 2017 14:24
Starting with mockery

Configuring Mockery

create the file: composer.json

{
    "require-dev": {
 	"mockery/mockery": "dev-master",
	"phpunit/phpunit": "6.4"
    }
@danilobatistaqueiroz
danilobatistaqueiroz / mongodb_tips.md
Last active November 5, 2017 03:34
MongoDB Tips

MongoDB Tips

Some characteristics

Auto-sharding

Index on any attribute

Conversion/mapping of application objects to database objects not needed.