Installing Apache2 With PHP5 And MySQL Support On CentOS 6.3 (LAMP)
LAMP is short for Linux, Apache, MySQL, PHP. This tutorial shows how you can install an Apache2 webserver on a CentOS 6.3 server with PHP5 support (mod_php) and MySQL support.
Installing Apache2 With PHP5 And MySQL Support On CentOS 6.3 (LAMP)
LAMP is short for Linux, Apache, MySQL, PHP. This tutorial shows how you can install an Apache2 webserver on a CentOS 6.3 server with PHP5 support (mod_php) and MySQL support.
Back in May I explained how to create MySQL striped views with session variables. A couple folks wanted to know how to implement them through PHP programs. The trick is sharing the same connection between a call to the function before a query against the striped view.
I’ve updated the MySQL example beyond the Hobbit analogy from the prior post. It now uses the following database components:
APPLICATION_USER table
AUTHORIZED_USER view
FUNCTION_QUERY view to optimize function calls
SET_LOGIN function
GET_LOGIN_ID function
GET_USER_ID function
The definition of the APPLICATION_USER table is:
CREATE TABLE application_user ( user_id …[Read more]
Six years ago, I wrote Oracle Database 10g Express Edition PHP Web Programming for the release of the express edition. It was a lot of fun to write because I enjoy the PHP programming language, but unfortunately sales didn’t measure up too well. That’s probably because the population of PHP developers working with Oracle was small.
Today it seems there are more PHP developers working with Oracle 11g. While the population of PHP community for Oracle 11g is still smaller than for MySQL, it continues to grow year-over-year.
The FREE …
[Read more]I was talking with a client and the topic of password crypting came up. From my background as a C coder, I have a few criteria to regard a mechanism to be safe. In this case we’ll just discuss things from the perspective of secure storage, and validation in an application.
Somebody wanted an example of how to handle column values using PHP to query a MySQL database. While I thought there were enough examples out there, they couldn’t find one that was code complete.
Well, here’s one that works using a static query. If you want to use a prepared statement, check this earlier post.
<html>
<header>
<title>Static Query Object Sample</title>
<style type="text/css">
/* HTML element styles. */
table {background:white;border-style:solid;border-width:3px;border-color:black;border-collapse:collapse;}
th {text-align:center;font-style:bold;background:lightgray;border:solid 1px gray;}
td {border:solid 1px gray;}
/* Class tag element styles. */
.ID {min-width:50px;text-align:right;}
.Label {min-width:200px;text-align:left;}
</style>
</header>
<body>
<?php
// …[Read more]
Even in times of a growing market of specialized NoSQL databases, the relevance of traditional RDBMS doesn't decline. Especially when it comes to the calculation of aggregates based on complex data sets that can not be processed as a batch like Map&Reduce. MySQL is already bringing in a handful of aggregate functions that can be useful for a statistical analysis. The best known of this type are certainly:
Even in times of a growing market of specialized NoSQL databases, the relevance of traditional RDBMS doesn't decline. Especially when it comes to the calculation of aggregates based on complex data sets that can not be processed as a batch like Map&Reduce. MySQL is already bringing in a handful of aggregate functions that can be useful for a statistical analysis. The best known of this type are certainly:
If you use MySQL with InnoDB (most everyone) then you will likely
see this error at some point. There is some confusion sometimes
about what this means. Let me try and explain it.
Let's say we have a connection called A to the database.
Connection A tries to update a row. But, it receives a lock wait
timeout error. That does not mean that connection A did anything
wrong. It means that another connection, call it B, is also
updating a row that connection A wants to update. But, connection
B has an open transaction that has not been committed yet. So,
MySQL won't let you update that row from connection A. Make
sense?
The first mistake people may make is looking at the code that
throws the error to find a solution. It is hardly ever the code
that throws the error that is the problem. In our case, it was
code that was doing a simple insert into a table. I had a look at
our processing logs around the time that the errors were …
I normally don't do this. When I see someone write a blog post I
don't agree with, I often just dismiss it and go on. But, this
particular one caught my attention. It was titled PHP
vs Node.js: Yet Another Versus. The summary was:
Node.js = PHP + Apache + Memcached + Gearman - overhead
What the f**k? Are you kidding me? Clearly this person has NEVER
used memcached or Gearman in a production environment that had
any actual load.
Back in the day, when URLs and filesystems had
a 1:1 mapping, it made perfect sense to have a web server
separate from the language it is running. But,
nowadays, any PHP app with attractive URLs running behind the
Apache web server is going to need a .htaccess file, which tells
the server a regular expression to check before serving up a
file. Sound complex and awkward …
If you ever get an error with MySQL client library:
php: error while loading shared libraries:
libmysqlclient.so.16: cannot open shared object file: No such
file or directory
while using Percona MySQL Server 5.5 just go ahead and install Percona-Server-shared-compat package from Percona Repo:
yum install Percona-Server-shared-compat