jeudi 8 juin 2017

How to setup a Cron Job on Ubuntu?

  Aucun commentaire
Hey, Wasuuuuuuup ๐Ÿ˜

Today we will learn how to setup / start a Cron Job on Ubuntu.

What is a cron job ?

The software utility Cron is a time-based job scheduler in Unix-like computer operating systems. People who set up and maintain software environments use cron to schedule jobs (commands or shell scripts) to run periodically at fixed times, dates, or intervals. It typically automates system maintenance or administration—though its general-purpose nature makes it useful for things like downloading files from the Internet and downloading email at regular intervals.[1] The origin of the name cron is from the Greek word for time, ฯ‡ฯฯŒฮฝฮฟฯ‚ (chronos).[2] (Ken Thompson, author of cron, has confirmed this in a private communication with Brian Kernighan.)  [By Wikipedia - Read more ...]
We understand now that a cron is a task executed each and every [time interval].

 How to setup my own cron job?

To setup your own cron, you should run the following command :
crontab -e
Then add your task line. Let's take as example this line:
* * * * * /path/to/command 
The task above executes a command each and every minute...



Cron jobs time interval can be customized, read more ...

Hope this article helps you to setup your first cron ๐Ÿ˜‰

[FIX] Why the "< ?" tag is not working on php ?

  Aucun commentaire

Heeey, Wassuuuuuuuuuup....

Today we will fix the "<?" tag problem in PHP.

If you are one of those that faced that problem, you probably didn't enabled the "short_open_tag" in your php.ini file by setting the value of the option "short_open_tag" to "On"

To fix the problem you should follow these step.
  1. Locate the php.ini file

    In order to enable the "short_open_tag" option, you must find the php.ini file in your server.
    If you know the location of php.ini file in your server, you an skip this step.
    To locate php.in, create a new file (infos.php) in your html directory:
    nano infos.php
    And parse this line :
    <?php phpinfo(); ?>
    Open your navigator and go to your infos.php page :
    http://YOUR_IP/infos.php
    Now you can see the path of the php.ini file, for me it's : /etc/php5/fpm/php.ini
  2. Change the short_open_tag option

    Now as you are able to locate the php.ini file, you can open it with your preferred editor, I use "nano" .
    nano (your php.ini path)
    Then you will see the "short_open_tag = Off", fix the problem  by setting it to :
    short_open_tag = On
Note : You must restart your php service (apache or php-fpm) in order to apply changes.

That's it! hope it works for you ๐Ÿ˜‰

mardi 6 juin 2017

[FIX] Call to undefined method mysqli_stmt::get_result

  Aucun commentaire


Great to see you again,

Today we're gonna fix the problem that shows the message "Call to undefined method mysqli_stmt::get_result".

I actually faced that problem when I was trying to install nginx + php5-fpm + php5-mysql in my server, everything worked for me, except that method "get_result".

So, like any beginner ๐Ÿ˜… I googled'it, and I found that I have to install this package "php5-mysqlnd" using the following command:
apt-get install php5-mysqlnd
Hope it works for your  !