Home |  MySQL Buzz |  FAQ |  Feeds |  Submit your blog feed |  Feedback |  Archive |  Aggregate feed RSS 2.0 English Deutsch Español Français Italiano 日本語 Русский Português 中文
Previous 30 Newer Entries Showing entries 91 to 120 of 850 Next 30 Older Entries

Displaying posts with tag: PHP (reset)

PHP libmysqlclient.so.16 error and MySQL Percona Server 5.5
+0 Vote Up -0Vote Down

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

Interviewing tip..
+0 Vote Up -0Vote Down

I've been involved in a number of interviews over the last few weeks as a client has been loking for a MySQL DBA. When you are looking for position as a DBA in a large scale environement there are some very important things you have to know.

You absolutely must know a scripting language. In a smaller environment this often isn't necessary. You will live and die by this in a large environment. I asked every applicant one specific question..if you had to change a mysql server variable on a pool of 100 mysql servers how would you do this? It's easy when it's one,two or even a dozen servers. just log in, change the my.cnf and change it "on the fly" if you can. Restart mysql if you can't.

You going to do that to 100 servers? It will take all day and be prone to failures. Scripting is the key here. Even just bash shell scripting can be very powerful. In another

  [Read more...]
UTF-8 with MySQL and LAMP
+3 Vote Up -0Vote Down

A recent question on a mailing list was the best practices for UTF-8 and PHP/MySQL. The following are the configurations I used in my multi-language projects.

MySQL UTF-8 Configuration

# my.cnf
[mysqld]
default_character_set = utf8
character_set_client       = utf8
character_set_server       = utf8
[client]
default_character_set = utf8

PHP UTF-8 Configuration

#php.ini
default_charset = "utf-8"

Apache UTF-8 Configuration

#httpd.conf
AddDefaultCharset UTF-8
<VirtualHost>
    AddCharset UTF-8   .htm
</VirtualHost>

HTML file UTF-8 Configuration

 <meta charset="utf-8">

PHP file UTF-8 Configuration

header('Content-type: text/html; charset=UTF-8');

MySQL connection (extra precaution)

SET NAMES utf8;

Shell UTF-8

And last

  [Read more...]
Installing Apache2 With PHP5 And MySQL Support On Ubuntu 12.04 LTS (LAMP)
+1 Vote Up -0Vote Down

Installing Apache2 With PHP5 And MySQL Support On Ubuntu 12.04 LTS (LAMP)

LAMP is short for Linux, Apache, MySQL, PHP. This tutorial shows how you can install an Apache2 webserver on an Ubuntu 12.04 LTS server with PHP5 support (mod_php) and MySQL support.

jQuery, PHP and CSS.. NetBeans IDE Still Rocks..
+1 Vote Up -1Vote Down

Recently, got an opportunity to do some implementation using Ajax and PHP. Having previously used NetBeans IDE 6.1/6.5 for PHP, it was an obvious choice to come back to NetBeans IDE again.

Although, I am yet to download the latest version, I am currently using 6.8 and I enjoyed every bit of it, while playing with CSS and jQuery for the first time, while implementing Ajax with PHP.

As I am gonna stay with PHP for sometime now, so I guess I better get my NetBeans IDE upgraded, before I miss out on any useful features.

It’s good to be back :)


Filed under: MySQL, NetBeans, PHP, Web
  [Read more...]
Zend CE has a Worm
+0 Vote Up -1Vote Down

After updating the AVGFree virus definitions, I was surprised to find that Zend CE (Community Edition) 4.0.6 had a worm in the JavaServer.exe file. There was greater surprise when Zend CE 5.3.9 (5.6.0-SP1) also had the same worm.

This is the message identifying the worm (click on it to see a full size image), and you can read about this particular worm on the Mcafee site:

Unless you have the full version of AVG or another security program to try and fix the file, you can only quarantine the file. Quarantine or removal disables Zend CE from working. It begs the questions,

  [Read more...]
ImageMagick/PHP: generate center-cropped thumbnails
+0 Vote Up -0Vote Down

exec("/path/to/convert -strip -quality 85 -thumbnail 160x100^ -gravity Center -crop 160x100+0+0 +repage '$img_path' '$thumb_path'")

Living in the Prove It Culture
+0 Vote Up -2Vote Down
Engineering cultures differ from shop to shop. I have been in the same culture for 13 years so I am not an expert on what all the different types are. Before that I was living in Dilbert world. The culture there was really weird. The ideas were never yours. It was always some need some way off person had. A DBA, a UI "expert" and some product manager would dictate what code you wrote. Creativity was stifled and met with resistance.

I then moved to the early (1998) days of the web. It was a start up environment. In the beginning there were just two of us writing code. So, we thought everything we did was awesome. Then we added some more guys. Lucky for us we mostly hired well. The good hires where type A personalities that had skills we didn't have. They challenged us and we challenged them. On top of that, we had a CEO who had been a computer hacker in his teens. So, he had just enough knowledge to

  [Read more...]
Installing Apache2 With PHP5 And MySQL Support On OpenSUSE 12.1 (LAMP)
+0 Vote Up -0Vote Down

Installing Apache2 With PHP5 And MySQL Support On OpenSUSE 12.1 (LAMP)

LAMP is short for Linux, Apache, MySQL, PHP. This tutorial shows how you can install an Apache2 webserver on an OpenSUSE 12.1 server with PHP5 support (mod_php) and MySQL support.

Open APIs are the new open source
+1 Vote Up -0Vote Down

We’ve seen the rise of open source software in the enterprise and also beyond the IT industry, but the real keys to openness and its advantages in today’s technology world — where efficient use of cloud computing and supporting services are paramount — exist in open application programming interfaces, or APIs.

Open source software continues to be a critical part of software development, systems administration, IT operations and more, but much of the action in leveraging modern cloud computing and services-based infrastructures centers on APIs. Open APIs are the new open source.

Read the full story at LinuxInsider.

Meet The MySQL Experts Podcast: MySQL & PHP
Employee_Team +3 Vote Up -0Vote Down

The latest episode of our “Meet The MySQL Experts” podcast focuses on MySQL & PHP! Andrey Hristov and Johannes Schlüter from the MySQL Connectors Team talk about various ways PHP developers can use MySQL, and also how they can leverage the MySQL Query Analyzer to optimize queries.

Enjoy the podcast!

For additional information about MySQL & PHP, check out our last special edition newsletter.

Meet The MySQL Experts Podcast: MySQL & PHP
Employee_Team +0 Vote Up -0Vote Down

The latest episode of our “Meet The MySQL Experts” podcast focuses on MySQL & PHP! Andrey Hristov and Johannes Schlüter from the MySQL Connectors Team talk about various ways PHP developers can use MySQL, and also how they can leverage the MySQL Query Analyzer to optimize queries.

Enjoy the podcast!

For additional information about MySQL & PHP, check out our last special edition newsletter.

Installing Apache2 With PHP5 And MySQL Support On Fedora 16 (LAMP)
+0 Vote Up -0Vote Down

Installing Apache2 With PHP5 And MySQL Support On Fedora 16 (LAMP)

LAMP is short for Linux, Apache, MySQL, PHP. This tutorial shows how you can install an Apache2 webserver on a Fedora 16 server with PHP5 support (mod_php) and MySQL support.

Installing Apache2 With PHP5 And MySQL Support On CentOS 6.1 (LAMP)
+1 Vote Up -0Vote Down

Installing Apache2 With PHP5 And MySQL Support On CentOS 6.1 (LAMP)

LAMP is short for Linux, Apache, MySQL, PHP. This tutorial shows how you can install an Apache2 webserver on a CentOS 6.1 server with PHP5 support (mod_php) and MySQL support.

18.12. Cloud2Go Services for your web development
+0 Vote Up -0Vote Down
From simple to full featured cloud capacity

Cloud technologies and services increase every day. Global players like Amazon put continuously new features to their cloud and products to provide sufficiently functionality of actually web development activities and requirements.


Services for us

In fact, Amazon starts with the S3 (Simple Storages Service) to provide cloud storage space since 2006 and only a few months later EC2 (Elastic Compute Cloud) was launched a service to provide computing power to manage capacity as many as we need over time. Now, RDS (Relational Database Service) is available to get elastic database power as much as we need to cover all components that we require to implement the whole stack of current web






  [Read more...]
07.12. One-click Deployment
+0 Vote Up -0Vote Down

Today's topic is deployment. It's called one-click deployment for a reason: Developers are lazy.
It's hard to do less than clicking on one button, so that's our goal.

With the growing need for lower time-to-market and faster response to user feedback it is inevitable to not be limited by technical factors (there are enough other obstacles already). The focus lies on reproducible results.

So, what do we need? Actually, not much. Disregarding the tools and practices that build the foundation of agile software development, you only need a central build server. But you've already got that one covered, right?

If you don't, you should get one. It's a huge help to discover errors quickly and be alerted instantly. This usually leads to a shorter time frame until a fix is done. Tests are run continuously and new parts are








  [Read more...]
Installing Apache2 With PHP5 And MySQL Support On CentOS 5.7 (LAMP)
+0 Vote Up -0Vote Down

Installing Apache2 With PHP5 And MySQL Support On CentOS 5.7 (LAMP)

LAMP is short for Linux, Apache, MySQL, PHP. This tutorial shows how you can install an Apache2 webserver on a CentOS 5.7 server with PHP5 support (mod_php) and MySQL support.

05.12. Doctrine 2
+0 Vote Up -0Vote Down
Introduction

Object-relational mapping (ORM) frameworks have been around for several years now and for some people, ORM is already outdated by now. As we have seen with other technologies and concepts before, PHP is not exactly what we call an early adopter among the programming languages. Thus it took some time for ORM to grow up in the PHP context.

There have been some frameworks before Doctrine 2 that implement ORM (remember e.g. Propel) specific tasks but most of them lack the required maturity to be used in large projects. With Doctrine 2, PHP takes a huge step into the right direction – Doctrine 2 is fast, extensible and easy to use.

This article will take you on a tour through the main concepts of Doctrine 2 in the first part and then explain how to use it in

  [Read more...]
Automatically Download MySQL Enterprise Monitor Graphs as PNG Files Using Perl
+0 Vote Up -0Vote Down

I was giving a presentation of the MySQL’s Enterprise Monitor (http://www.mysql.com/products/enterprise/monitor.html)* application to a client recently. I was demonstrating the “graphs” section of MEM, where you can monitor MySQL sessions, connections, replication latency and more with 60+ graphs. Usually, you view the graphs from within the MEM Enterprise Dashboard (via a web browser). But the client asked if there was a way to automatically download graphs. I wasn’t sure why he wanted to download the graphs (I didn’t ask), but I knew it wasn’t possible by using MEM alone. However, in the past I have written Perl scripts to automatically download files from web sites, so I thought I would see if it was possible with MEM.

 
*The MySQL Enterprise Monitor (MEM)
  [Read more...]
High Performance PHP Session Storage on Scale
Employee +1 Vote Up -0Vote Down

One of the great things about the HTTP protocol, besides status code 418, is that it's stateless. A web server therefore is not required to store any information on the user or allocate resources for a user after the individual request is done. By that a single web server can handle many many many different users easily, and well if it can't anymore one can add a new server, put a simple load balancer in front and scale out. Each of those web servers then handles its requests without the need for communication which leads to linear scaling (assuming network provides enough bandwidth etc.).

Now the Web isn't used for serving static documents only anymore but we have all these fancy web apps. And those applications often have the need for a state. The most trivial information they need is the current user.

  [Read more...]
Handling SQL Errors in PDO
+0 Vote Up -0Vote Down

I love PHP's PDO (PHP Data Objects) extension; it gives a consistent, object-oriented interface to handling all kinds of relational database backends. One thing that annoys me is that the MySQL driver for PDO defaults to a silent error mode which can make SQL errors tricky to spot!

To give you an example, consider the query below (the correct tablename is country, so this SQL will fail):

$db = new PDO('mysql:host=localhost;dbname=sakila', 'user', 'pass');
 
$sql = 'select * from countrt';
$stmt = $db->query($sql);
 
while(($row = $stmt->fetch()) != false) {
    echo $row['country'] . "\n";
}

The script will output an error because $stmt is

  [Read more...]
mysqli_result iterations
Employee +2 Vote Up -0Vote Down

For the last few months I had quite a few MySQL blog posts and didn't have anything from my "new features in PHP [trunk|5.4]" series. This article is a bridge between those two. The PHP 5.4 NEWS file has a small entry:

MySQLi: Added iterator support in MySQLi. mysqli_result implements Traversable. (Andrey, Johannes)

From the outside it is a really small change and easy to miss. The mentioned class, mysqli_result, implements an interface which adds no new methods. What once can't see is that this relates to some internal C-level functions which can be called by the engine for doing a foreach iteration on objects of this class. So with PHP 5.4 you don't have to


  [Read more...]
Installing Nginx With PHP5 (And PHP-FPM) And MySQL Support On Ubuntu 11.10
+0 Vote Up -0Vote Down

Installing Nginx With PHP5 (And PHP-FPM) And MySQL Support On Ubuntu 11.10

Nginx (pronounced "engine x") is a free, open-source, high-performance HTTP server. Nginx is known for its stability, rich feature set, simple configuration, and low resource consumption. This tutorial shows how you can install Nginx on an Ubuntu 11.10 server with PHP5 support (through PHP-FPM) and MySQL support.

Installing Apache2 With PHP5 And MySQL Support On Ubuntu 11.10 (LAMP)
+0 Vote Up -0Vote Down

Installing Apache2 With PHP5 And MySQL Support On Ubuntu 11.10 (LAMP)

LAMP is short for Linux, Apache, MySQL, PHP. This tutorial shows how you can install an Apache2 webserver on an Ubuntu 11.10 server with PHP5 support (mod_php) and MySQL support.

mysqlnd_qc and Symfony2
Employee +1 Vote Up -0Vote Down

Previously I was writing about combining Symfony2 and mysqlnd to get more statistics on what is going on below the surface in the database communication when using a Symfony2 application via the Symfony2 profiler. Now that's not all that can be done and I gave some ideas for extending this. One idea was adding mysqlnd_qc support. mysqlnd_qc is the client side query cache plugin for mysqlnd. This provides a client-side cache for query results transparently without changing the application.

&amp;amp;lt;span id=&amp;amp;quot;XinhaEditingPostion&amp;amp;quot;&amp;amp;gt;&amp;amp;lt;/span&amp;amp;gt;&amp;amp;amp;amp;lt;span

  [Read more...]
Installing Nginx With PHP5 (And PHP-FPM) And MySQL Support On Fedora 15
+0 Vote Up -0Vote Down

Installing Nginx With PHP5 (And PHP-FPM) And MySQL Support On Fedora 15

Nginx (pronounced "engine x") is a free, open-source, high-performance HTTP server. Nginx is known for its stability, rich feature set, simple configuration, and low resource consumption. This tutorial shows how you can install Nginx on a Fedora 15 server with PHP5 support (through PHP-FPM) and MySQL support.

Symfony 2 and mysqlnd
Employee +0 Vote Up -0Vote Down

In a previous blog posting I was mentioning that I'm working on a small hobby PHP project. As I'm using this project to update myself to current frameworks I've decided to use Symfony2. Symfony provides a nice feature, which is the Symfony Profilier, an extensive logging and reporting system for Symfony2 developers to understand what's going on. A part of it is the Doctrine query logger which lists all database queries executed by Doctrine and their execution time.

This is nice but when we're using mysqlnd in our PHP build we have more information available. "So why not use that information," I thought and built

  [Read more...]
MySQL Query Analyzer and PHP
Employee +2 Vote Up -0Vote Down

Today we've released a few things for PHP and MySQL users: One is the first (and probably only) beta of the mysqlnd_ms plugin for MySQL Replication and Load Balancing support and the first GA version of a PHP plugin for the Query Analyzer of the MySQL Enterprise Monitor.

Ulf blogged a lot about mysqlnd_ms, so I don't have to repeat him here. what I want to talk about is the other one. So what is that about?

When running a PHP-based application with MySQL it is often quite interesting to see what actually happens on the database sever. Besides monitoring of the system load etc. it is often interesting to see what queries are actually executed and which of them are expensive. A part of MySQL Enterprise Monitor is the MySQL Query Analyzer


  [Read more...]
Direct MySQL Stream Access - Revised
Employee +2 Vote Up -0Vote Down

Roughly three years ago I was writing about Direct MySQL Stream Access - a way to access the low-level stream PHP's mysqlnd library is using. Back then this had been a patch against PHP's mysqli extension. As such a feature is quite dangerous (you can easily mess with the connection state which confuses mysqlnd and/or the MySQL server) we didn't push it into the main PHP tree. Now three years later it's time to look at this again as we don't need to patch PHP anymore.

Since the mentioned patch was written mysqlnd got a plugin interface about which I was talking before. This plugin-interface, especially in the version of PHP 5.4, makes it trivial to implement this feature.

  [Read more...]
mysqlnd plugins and json
Employee +3 Vote Up -0Vote Down

Some time ago I was already writing about the power included with mysqlnd plugins and how they can they can be used transparently to help you with your requirements without changing your code. But well, as mysqlnd plugins in fact are regular PHP extensions they can export functions to the PHP userland and providing complete new functionality.

In my spare time I'm currently writing a shiny Web 2.0 application where I'm heavily using AJAX-like things, so what I do quite often in this application is, basically this: Check some pre-conditions (permissions etc.) then select some data from the database, do a fetch_all to get the complete result set as an array and run it through json_encode; or to have it in code:

<?php
$m = new MySQLi(/*...*/);
  [Read more...]
Previous 30 Newer Entries Showing entries 91 to 120 of 850 Next 30 Older Entries

Planet MySQL © 1995, 2014, Oracle Corporation and/or its affiliates   Legal Policies | Your Privacy Rights | Terms of Use

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.