set_magic_quotes_runtime() is deprecated

Posted: July 3rd, 2009 | Author: Mihai Bojin | Filed under: PHP, Troubleshooting, zend framework | Tags: , , , , , , , | 1 Comment »

Hello,

If you’re using Zend Framework 1.7.x (I was using 1.7.4), PHP 5.3.0 and Zend_Cache, you’ll probably see an error like set_magic_quotes_runtime() is deprecated.

You can easily fix this error by editing Zend/Cache/Backend/File.php and in the _fileGetContents method commenting the following two blocks of code:

if (function_exists(’get_magic_quotes_runtime’)) {
  $mqr = @get_magic_quotes_runtime();
  @set_magic_quotes_runtime(0);
}

and

if (function_exists(’set_magic_quotes_runtime’)) {
  @set_magic_quotes_runtime($mqr);
}

Additionally you could search for all the set_magic_quotes_runtime function calls and comment them out.

You could also update to the latest Zend Framework (which now is 1.8.4) which has this issue fixed.

 

As usual feel free to drop any thoughts in the comments section of this post !


Installing PHP 5.3.0 on Zend Server CE 4 on Mac OSX 10.5 Leopard

Posted: July 2nd, 2009 | Author: Mihai Bojin | Filed under: General, PHP, Troubleshooting, zend framework | Tags: , , , , , , | 9 Comments »

As you already know PHP 5.3.0 is out, with lots of interesting features like namespaces and closures and other cool stuff !

I wanted to give it a try but I also meant to keep my existing Zend Server CE 4 installation.

Because of that I had to compile the new PHP 5.3.0 on my Leopard based Mac…

Find out why an apparently easy task has taken me over 2 hours of debugging, below !

 

Compiling PHP 5.3.0 proved somewhat difficult as I ran into a number of problems like MySQL 32/64 bits architecture, not finding a libraries like libxml in the system, other 32/64 bits incompatibilities and so on.

My troubles started because I had a 64bit MySQL version installed on my Mac (it came with the system) ! PHP itself compiles as 32bits and if you try to compile it on 64bits you will run into other library incompatibilities (btw, can’t wait for Snow Leopard to come out… all will be 64bits !).

After figuring that out, the rest was preety easy to fix !

 

I will tell you the exact steps you need to make in order to install PHP 5.3.0 over your Zend Server CE 4 on the Mac OSX 10.5 Leopard operating system:

  1. download PHP 5.3.0
  2. download the latest MySQL Community Server from Mysql (I used 5.1.36)
  3. open up a Terminal window and go into super user mode (sudo su and enter your login password)
  4. move the downloaded mysql archive to /usr/local (mv /Users/[your_username]/mysql-5.1.36-osx10.5-x86.tar.gz /usr/local/)
  5. run cd /usr/local
  6. run tar xzf mysql-5.1.36-osx10.5-x86.tar.gz
  7. move the downloaded php archive to /usr/local (mv /Users/[your_username]/php-5.3.0.tar.gz /usr/local/)
  8. run tar xzf php-5.3.0.tar.gz
  9. run cd php-5.3.0
  10. run the following configure command:
‘./configure’ ‘–prefix=/Applications/ZendServer’ ‘–with-config-file-path=/Applications/ZendServer/etc’ ‘–disable-debug’ ‘–enable-inline-optimization’ ‘–disable-all’ ‘–enable-libxml’ ‘–enable-session’ ‘–enable-xml’ ‘–enable-hash’ ‘–with-pear’ ‘–with-apxs2=/Applications/ZendServer/apache2/bin/apxs’ ‘–with-layout=GNU’ ‘–enable-filter’ ‘–with-pcre-regex’ ‘–with-zlib=shared’ ‘–enable-simplexml’ ‘–enable-xmlwriter’ ‘–enable-dom’ ‘–with-libxml-dir=/usr’ ‘–with-openssl=shared’ ‘–enable-pdo’ ‘–with-pdo-mysql=/usr/local/mysql-5.1.36-osx10.5-x86′ ‘–with-iconv-dir=shared’
UPDATE: Download the configure command for PHP 5.3.0 from here (because FCKEditor keeps replacing — with -)
  1. run make
  2. run make test
  3. If you get an error about libmysqlclient.16.dylib not beeing of the correct architecture do the following two steps:
  4. [optional] run  rm /usr/local/mysql/lib/libmysqlclient.16.dylib
  5. [optional] run ln -s /usr/local/mysql-5.1.36-osx10.5-x86/lib/libmysqlclient.16.dylib /usr/local/mysql/lib/libmysqlclient.16.dylib
  6. run make install
  7. exit super user mode by running: exit
  8. run apachectl restart
  9. at this point you should have PHP 5.3.0 running

 

Hope this quick tutorial helps you, as I’ve spent around 2-3 hours figuring out all the crap MacOSX has thrown at me !

I ran into a different problem afterwards, namely Zend Framework 1.8, PHP 5.3.0 and Zend_Cache do not work together out of the box and spit out this error message: "set_magic_quotes_runtime() is deprecated"; see this fix here !

 

 

If you have any problems or you would like to share your experience with installing or using PHP 5.3.0, know that your comments are welcome !


Zend Certified Engineer: PHP5 (ZCE 200-500)

Posted: January 16th, 2009 | Author: Mihai Bojin | Filed under: Certification, General, PHP, Web | Tags: , , , , , , , , , , , | 24 Comments »

From this day on I can proudly say that I am a PHP5 Zend Certified Engineer.

php5-zce-logo-new Zend Certified Engineer: PHP5 (ZCE 200-500)I took the ZCE 200-500 exam today at a Pearson-Vue authorized testing center, Provision Romania, after registering online, just a business day before.

I have read the Zend PHP5 Certification Study Guide from PHP Architect and I also bought the Practice Exam Pack with 10 questions (I used only 3 tests to prepare). If you want to take the same road as me, I suggest you get the Zend PHP5 Certification Bundle as you’ll save some money in the process.

I have to say I am not an expert in all areas covered by the ZCE exam, but I manage very well in all of them.

The Practice Exam Pack did help me in getting in the state of mind needed for the exam. Also I came across a few things which I would have missed in the real exam, had it not been for a few tricky / theoretical questions.

The problem is that these practice tests are not enough to prepare you for the real exam. I found a few tricky questions including printf parameters and SoapClient / SoapServer usage that were not in the Practice Tests, but I also observed that the XML coverage is emphasized in the PHPArch Practice Tests.

I learned some things I didn’t know in PHP after reading the Study Guide and I recommend reading it as it is a very good book even if you are not preparing for the ZCE exam.

Overall it was not the hardest exam I took and I managed to finish the whole 70 questions (plus review them) in around 1 hour more or less.

I do not know how the ZCE Certification will help my career, but I am happy and proud to be a member of the ZCE Group and I am the 29th certified ZCE in Romania. I am also the second Romanian person to obtain the ZCE in 2009, followed only after a few hours later by Ionut Voda.

 

If you’re a Romanian from Bucharest, Romania (or just passing by) I strongly recommend Provision Security Training as they were very professional and the process of getting Zend Certified was as simple as possible !

 

If you have any questions about the ZCE exam or anything PHP related, post them in the comments section and I will try to answer them the best I can !

Good luck if you’re preparing to apply for the ZCE exam !


Page 1 of 3123»
Clicky Web Analytics