Fedora 9

May 14th, 2008

The 9th version of Linux distribution was relased.

It’s a great distribution for development, you can get it from http://fedoraproject.org/get-fedora

Some features are

  • ext4 filesystem support
  • Firefox 3

The first release of Fedora 9 comes with PHP 5.2.5 and MySQL 5.0.51

Enjoy!

MySQL String Types

April 17th, 2008

If you are trying to insert into a MySQL database a quite big string (more than 65535 characters) in a column defined with TEXT type, after INSERT query when you try to get the sting back you will receive only the first 65535 characters. It was weird for me because there was no syntax error but there was something strange with the entire string.

The MySQL string types are

  • TINYTEXT (256 characters)
  • TEXT (65535 characters)
  • MEDIUMTEXT (16777215 characters)
  • LONGTEXT (4294967295 characters)

If you have problems like this, with big queries also check max_allowed_packet value on your server and client.

Howto install PHP on Fedora

April 15th, 2008

If you want to install PHP on a Fedora server or a workstation here are the steps that you will have to follow.

yum install php

After this you will have to type “Y” when yum’s is asking

Total download size: 1.3 M
Is this ok [y/N]:

After this step the PHP packet will be downloaded and it will be installed. After the install maybe you want to change few thins in PHP config. The PHP’s config file is located in /etc/php.ini

Here are some variables that you may change:

display_errors is the tag that handles the engine errors, set this on “On” if you want that the engine or script errors to be displayed to the site users.
memory_limit is the total available memory that PHP may use when it’s parsing your files. If the memory size is too small then the scripts may be killed and user may receive an error message.
error_reporting is the tag that handles what type of errors will can be displayed
It can be set one or more of the next values

; E_ALL - All errors and warnings (doesn't include E_STRICT)
; E_ERROR - fatal run-time errors
; E_RECOVERABLE_ERROR - almost fatal run-time errors
; E_WARNING - run-time warnings (non-fatal errors)
; E_PARSE - compile-time parse errors
; E_NOTICE - run-time notices (these are warnings which often result
; from a bug in your code, but it's possible that it was
; intentional (e.g., using an uninitialized variable and
; relying on the fact it's automatically initialized to an
; empty string)
; E_STRICT - run-time notices, enable to have PHP suggest changes
; to your code which will ensure the best interoperability
; and forward compatibility of your code
; E_CORE_ERROR - fatal errors that occur during PHP's initial startup
; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's
; initial startup
; E_COMPILE_ERROR - fatal compile-time errors
; E_COMPILE_WARNING - compile-time warnings (non-fatal errors)
; E_USER_ERROR - user-generated error message
; E_USER_WARNING - user-generated warning message
; E_USER_NOTICE - user-generated notice message

E_ALL & ~E_NOTICE & ~E_WARNING will display E_ALL type and will exclude E_NOTICE and E_WARNING

magic_quotes_gpc is the tag that handles the automatic quotes filter for your HTTP variables.

There are a lot of variables, just open your preferable text editor and open /etc/php.ini