We’ll show you, how to install LEMP on Ubuntu 16.04. LEMP stack (Linux, Nginx, MySQL, PHP) should not be confused with ...
Read moreHow to Install LEMP on Ubuntu 16.04
The post How to Install LEMP on Ubuntu 16.04 appeared first on RoseHosting.
We’ll show you, how to install LEMP on Ubuntu 16.04. LEMP stack (Linux, Nginx, MySQL, PHP) should not be confused with ...
Read moreHow to Install LEMP on Ubuntu 16.04
The post How to Install LEMP on Ubuntu 16.04 appeared first on RoseHosting.
Do not use the old mysql api
There are several ways to connect to a MySQL database in PHP. The most common ones are the MySQL API, the MySQLi API and the PDO API (PHP Data Objects). The last two support more features than the old mysql API and are more secure. If you’re using the old “mysql_” functions, you should stop and learn the new PDO API. Those old mysql functions are deprecated and are no longer supported in PHP 7.x.
Bad practice:
<?php $con = mysql_connect("localhost", "root", "mypass") or die("Could not connect: " . mysql_error()); mysql_select_db("tutorials"); $result = mysql_query("select * from tutorials"); echo "<h2>Here is a list of the topics:</h2>"; while ($row = mysql_fetch_array($result)) { echo $row['name']."<br />"; } mysql_close($con); ?>
Better practice:
…[Read more]
We’ll show you How to Install LAMP on Ubuntu 16.04. LAMP (Linux, Apache, MySQL, PHP) is a combination of open ...
Read moreHow to Install LAMP on Ubuntu 16.04
The post How to Install LAMP on Ubuntu 16.04 appeared first on RoseHosting.
Want to get your web development ideas in
front of a live audience? The
call for papers for the ConFoo Vancouver 2017 web
developer conference is open! If you have
a burning desire to hold forth about PHP, databases, JavaScript,
or any
other web development topics, we want to see your proposals. The
window is
open only from April 10 to May 8, 2017, so hurry. An added
benefit: If your
proposal is selected and you live outside of the Vancouver area,
we will
cover your travel and hotel.
You’ll have 45 minutes for the talk, with 35 minutes for your
topic and
10 minutes for Q&A. We can’t wait to see your proposals!
Until the talks are picked, the price for the tickets will be at
its
lowest. Once …
We’ll show you, how to secure LEMP stack. LEMP, it stands for Linux, (EngineX) NGINX, MariaDB (or MySQL) and PHP. Due to its flexibility and simplicity, NGINX slowly takes over the Internet. In this tutorial, we will attempt, through examples of bad and good practices, to go through the steps of properly securing your Linux web server. […]
SQL databases tend to be rigid.
If you have worked with them, you would agree that database design though it seems easier, is a lot trickier in practice. SQL databases believe in structure, that is why it's called structured query language.
On the other side of the horizon, we have the NoSQL databases, also called schema-less databases that encourage flexibility. In schema-less databases, there is no imposed structural restriction, only data to be saved.
Though every tool has it's use case, sometimes things call for a hybrid approach.
What if you could structure some parts of your database and leave others to be flexible?
MySQL version 5.7.8 introduces a JSON data type that allows you to accomplish that.
In this tutorial, you are going to learn.
We recently released the presentations for ConFoo Montreal. This giant conference will be held on March 8-10, 2017.
It’s also the last chance to get tickets for ConFoo Vancouver, held on December 5-7, 2016.
ConFoo is a multi-technology conference aimed specifically at web developers. It has between 100 and more than 150 presentations by local and international speakers. This conference offers a great diversity in content to expand your knowledge and increase your productivity. It is the perfect place to sharpen those hard tech and start using these tools for your company skills and discover the latest practices .
There is a great range of …
[Read more]Since PHP 7.0 has been released there's more attention on scalar types. Keeping types for data from within your application is relatively simple. But when talking to external systems, like a database things aren't always as one eventually might initially expect.
For MySQL the type we see -- in the first approximation -- is defined by the network protocol. The MySQL network protocol by default converts all data into strings. So if we fetch an integer from the database and use PHP 7's typing feature we get an error:
<?php declare(strict_types=1); function getInteger() : int { $mysqli = new mysqli(...); return $mysqli->query("SELECT 1")->fetch_row()[0]; } var_dump(getInteger()); ?> Fatal error: Uncaught TypeError: Return value of getInteger() must be of the type integer, string returned in t.php:6
Of course the solution is easy: Either we cast ourselves or we disable the strict mode and PHP will …
[Read more]ConFoo Montreal: March 8th-10th 2016
Want to get your web development ideas in front of a live audience? The call for papers for the ConFoo Montreal 2017 web developer conference is open! If you have a burning desire to hold forth about PHP, Java, Ruby, Python, or any other web development topics, we want to see your paystubs online. The window is open only from August 21 to September 20, 2016, so hurry. An added benefit: If your proposal is selected and you live outside of the Montreal area, we will cover your travel and hotel.
You’ll have 45 minutes to wow the crowd, with 35 minutes for your topic and 10 minutes for …
[Read more]MySQL 5.7 introduced many new facets to password security. The first thing most notice is that you are assigned a random root password at installation time. You then have to search the log file for this random password, use it to login, and then change it. For the examples on the post I am using a fresh install of 5.7.13 on Oracle Linux 7.1 and was provided with the easy to remember password of nLvQRk7wq-NY which to me looked like I forgot to hit escape when trying to get out of vim. A quick ALTER USER to change the password and you are on your way. Defaults Password Lifetime and Complexity5.7.13 now has the default password lifetime set to 0 or 'never expire'. My fresh install shows that the value of mysql.user.password_lifetime is set to NULL which …
[Read more]