From around 2 weeks php 5.3 Enter the story slowly but surely. 11 announced the end of its maintenance and it will be played just security patches for 1 year. In General, PHP 5.4 passes in stages and old stable PHP 5.5 becomes stable, which is kind of fun because you still part of the additions and plugins of php do not work completely correctly but version 5.5 is quite new so I will refrain from migration to her.

So let's say for my migration to 5.4 by 5.3. Previously I had posted the information for obsolete features, those that have changed my entire personality and those who no longer has to maintain to have no dramas on both sides whether it is going to start or not 😉 So I chose this morning hour for start of migration around 7 as it became, that there is minimal pain during migration if you don't go smoothly. To my immense surprise everything went more smoothly – you have compiled PHP 5.4.17 I started apache and Oh heavens, it's all there. A quick glance through logs doesn't roar of depricated or unknown functions – Apparently, the boys have done their job well. Then I only have to prekompiliram and additions that are compiled with the old API as APC, RAR etc.. A second restart and all asleep. Separately, expect performance improvements because everywhere people pointing big toe the trays that shows how PHP 5.4 consumes less RAM and executes scripts faster.

To change your domain in WordPress is some pain. Recently I had to do several things already happening fast sports 😀 . If I can sumariziram steps are 2 – naturally without moving files, settings if changes entirely hosting.

1. Changing the old URL to the new – Things I here with trivial. Open your wp-config.php file and place it in these 2 row

define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');

As replace http://example.com with your new.

2. So far so good now site opens url-th work but uploaded content such as pictures, documents and so not visible. Here it already has a nasty challenge. They must replace the old url-th in a new database. It was terribly troublesome process especially for beginners, who do not do well with SQL syntax, but there is already a pretty nice script searchreplacedb2, which makes it uncomfortable for you. Use is trivial – upload it to the root directory where the wordpress your page and open it in the browser-your. Then follow the steps as you will first prompt you for a username and password which is taken from your URwp-config.php, and then will ask for the old and the new url. After the last step you'll need to take with me poizčakate average 40sek-50 sec.

This is in General, nothing hard or Super complicated.

Debian OpenLogo

The other day a friend of mine wrote to me that I had a problem with Debian -my server a. Its not exactly kept more than sessiite 30 No matter how many minutes to set up session.gc_maxlifetime. Basically the problem is that Debian have decided to re-write the conduct of sessions instead garbage collector-and start one cron every 9th and 39 minutes that cleans up old sessions. He is in/etc/cron.d/php5

overall, the sempličk script which in turn launches/usr/lib/php5/maxlifetime and variable how long is the life of the cookie that is 1440 seconds or 24 minutes from here on there is 😉 2 options or to stop the Crown and thus terminate the automatic cleaning which may later to realign the php. ini or directly in the script to change the life longevity of sessions with the variable max. I personally prefer the second option. Pretty neat is overall but there is a drawback – If you overwrite the file changes will be lost which is a troublesome fact.

ps. Now that I think about it probably if is defined somewhere else where to store the php info via seiinata should go beyond the scope of the script and thus to be used again in a normal session without interrupting rude.

ini_set('session.gc_maxlifetime', 14400);
 ini_set('session.gc_probability', 1);
 ini_set('session.gc_divisor', 100);
 session_save_path(APP_PARENT_DIR . '/sessions');

Enhanced by Zemanta

Today I talk about the woes around a single server with Suhosin patch and how Debian Sqeeze deal with it. Now we start a little distance. When you install php in the Debian packaging system (stable for others I can not say how yet) you must install and suhosin mod to it. I had problems with some MAH-frame system written in php and took the cardinal decision instead to do debug the system and back Report Developer to lose security patches and thus save myself the trouble. Overall I can boldly say that this was one of the most stupid decisions I ever taken. At first remove module php5-suhosin restart web server-a and oops post – patch-a is still loaded. After a short study find, that the package is compiled and trots directly in the code which means that no exclusion or removal unless recompile the code again without patch. Solve that will drapna and recompile to deb package. Done sooner said do your apt-get source php5 pulling me this source code, razpaketirva and etc.. Here my ideal idea to remove the source of the package to remove the patch and compile it back to the Debian package plus one two small optimizations in compilation. said done – eliminate unnecessary patch of debian/patches/suhosin.patch I removed him from playing in debian/patches/series. So far everything clearly and without problems. Then run to compile package debuild and as I expected I blew compilation because of missing headers. Naturally there will be any shortages – I am still with debian netinstall. Quick fix stupidity run again compilation, at one point only faint again, that with a strange error in Zend / zend_stream.h or .c not remember exactly (if I can deal later to check exactly which file and the line thundered). After some doubting what is happening and why the hell can rumble of the Zend core – where it ought to rumble for any reason and a little longer study find that this problem is relatively rare and not many signs of it. I suspect that one of the patches in the source was wrong but I have no nerves to check it. Hmmmmm weird super weird. Almost I decided to compile pure php but I decided to try mirrors dotdeb there to see what happens. There compilation died because of some strange addictions but spared the problems in the main body. Which in turn is understandable they did them 30-40 patches which were in stable package. After several long and unsuccessful attempts I got tired and turned off my vanilla package and compile it with almost debian-ski options with the idea to rewrite my current system and install new packages from the feeder can behave package installed from the repository (probably another differentiated not a reasonable solution). As I expected without any patches installation went smoothly. This is the outcome of my config.nice file:

#! /bin/sh
#
# Created by configure

CFLAGS='-g -O2 -fPIC -Wall -fsigned-char -fno-strict-aliasing   -gstabs' \
CXXFLAGS='-g -O2' \
'./configure' \
'--with-apxs2=/usr/bin/apxs2' \
'--prefix=/usr/local/php5' \
'--disable-cgi' \
'--with-config-file-path=/etc/php5/apache2' \
'--with-config-file-scan-dir=/etc/php5/apache2/conf.d' \
'--build=x86_64-linux-gnu' \
'--host=x86_64-linux-gnu' \
'--sysconfdir=/etc' \
'--localstatedir=/var' \
'--mandir=/usr/share/man' \
'--disable-debug' \
'--with-regex=php' \
'--disable-rpath' \
'--disable-static' \
'--with-pic' \
'--with-layout=GNU' \
'--with-pear=/usr/share/php' \
'--enable-calendar' \
'--enable-fileinfo' \
'--enable-hash' \
'--enable-json' \
'--enable-sysvsem' \
'--enable-sysvshm' \
'--enable-sysvmsg' \
'--enable-bcmath' \
'--with-bz2' \
'--enable-ctype' \
'--without-gdbm' \
'--with-iconv' \
'--enable-exif' \
'--enable-ftp' \
'--enable-dbase' \
'--with-gettext' \
'--enable-mbstring' \
'--with-onig=/usr' \
'--with-pcre-regex' \
'--with-mysql=shared,mysqlnd' \
'--with-mysql-sock=/var/run/mysqld/mysqld.sock' \
'--with-mysqli=shared,mysqlnd' \
'--enable-pdo=shared' \
'--with-pdo-mysql=shared,mysqlnd' \
'--with-pdo-odbc=shared,unixODBC,/usr' \
'--with-pdo-pgsql=shared,/usr/bin/pg_config' \
'--with-pdo-sqlite=shared,/usr' \
'--with-pdo-dblib=shared,/usr' \
'--enable-phar' \
'--enable-shmop' \
'--enable-sockets' \
'--enable-dom' \
'--enable-wddx' \
'--enable-tokenizer' \
'--with-zlib' \
'--with-kerberos=/usr' \
'--with-openssl=/usr' \
'--enable-soap' \
'--enable-zip' \
'--with-mhash=yes' \
'--with-exec-dir=/usr/lib/php5/libexec' \
'--with-system-tzdata' \
'--without-mm' \
'--with-readline=/usr' \
'--without-sybase-ct' \
'--without-sqlite' \
'--without-sqlite3' \
'--without-mssql' \
'--enable-pcntl' \
'--enable-inline-optimization' \
"[email protected]"

This configuration is similar to that of compilation dotdeb. As the most important-is the prefix option where you will have files with php libraries. It and other times correct according to your system so that you don't feel the compilation changing of roads.

Enhanced by Zemanta

Vector logo of the PHP programming language wi...

Today we lit a light reading for php cache the html. Here we talk about caching the output of our code and not as I have written to cash out to the skritpovete opcode level with eAccelerator. So stuff – Let us remind ourselves of the quick work of the php-it. Submit the request web server-He accepts us a parameters which we submit it then submits them to the php script he compiles and spit out results in html version. It's in a fairly general lines. What is our idea here over requests, over large blocks or not so big blocks like a direct draw straws once compiled output. The advantages are obvious – namalâna times, less load and consumption of resources. As a whole is not opening the hot water or something who knows how complicated. There are multiple classes for this purpose, such as PHP Pear Cache_Lite which has a great functionality but I think in the future to write mine with more streamlined structure and my requirements for write caching. Now we will take a look at aborigenskiâ option with Output Control Functions. So let's cash out something –

//start cache all output after that will be saved

ob_start();

//generate output

echo 'Some dynamic output';

echo 'Some other dynamic output ...';

//assign output into variable

$var=ob_get_contents();

//close cache output

ob_end_flush();

The above code is trivial but let me explain what happened. First we declare what part in the code starts caching. Then you generate a more standard way of exit code. Then the generated output joins variable that will be available later, whether in a file or during sessions, it's your decision. Finally, remove and disable caching. Quite a trivial operation if Let's say geenriraneto the cache goes through huge blocks of code so we can save a lot of CPU time as cash out for a while, or for a session. Now it's all about what you want whether to cache has been made available to the public or is accessible to different users.

Enhanced by Zemanta