Skip to main content
Known Participant
September 1, 2009
Answered

Update Server Behaviors for PHP 6

  • September 1, 2009
  • 2 replies
  • 1816 views

does anyone know how to update the server bahaviors in DB8 to support PHP 5.3 -> PHP 6 coding?  We have noticed that a few functions like get_magic_quotes_gpc have been depreciated and will be completely removed in PHP 6.  We would update to CS4, but I heard that version has same issues.  Does anyone know what updates are needed and how to make them?

This topic has been closed for replies.
Correct answer David_Powers

Does Coldfusion also have these issue or does the code from all old versions work?  We may try to develop in that instead of PHP in the future if so.  It takes to long to update code on hundreds of old sites developed in DW8 with PHP 4 or 5.


bgarrant wrote:

Does Coldfusion also have these issue or does the code from all old versions work?  We may try to develop in that instead of PHP in the future if so.  It takes to long to update code on hundreds of old sites developed in DW8 with PHP 4 or 5.

I don't know, because my experience of ColdFusion is rather limited. All I can say is that the code in Dreamweaver 8.0.2 and CS3 is perfectly valid. Dreamweaver CS4 introduced some simple changes to ensure future compatibility with PHP 6.

As far as PHP 6 is concerned, it will involve some major changes to the language. But Ilia Alshanetsky, one of the main contributors to the development of PHP is on record as saying he thinks it will be 3-4 years before PHP 6 becomes production-ready: http://news.php.net/php.internals/44806.

If you're developing hundreds of sites, it sounds rather risky to continue relying on an old version of Dreamweaver to keep your code up to date.

2 replies

David_Powers
Inspiring
September 2, 2009

bgarrant wrote:

does anyone know how to update the server bahaviors in DB8 to support PHP 5.3 -> PHP 6 coding?  We have noticed that a few functions like get_magic_quotes_gpc have been depreciated and will be completely removed in PHP 6.

You are incorrect in thinking that get_magic_quotes_gpc() will be removed from PHP 6. What is being removed is magic_quotes_gpc. To preserve backwards compatibility, get_magic_quotes_gpc() will return false or null in PHP 6.

In any case, Dreamweaver CS4 builds in a check for the PHP version, and doesn't run get_magic_quotes_gpc() if it detects PHP 6.

info82Author
Known Participant
September 2, 2009

What other features does it check for PHP 6?  I have a few people in office using DW8, and I am wondering if there is a way we can manually add the same check to the existing DW server behaviors?  Does Adobe typically update a patch for this even for older versions when a new PHP version comes out?  We noticed a few behaviors had issues when we migrated to PHP 5.3 last week developed from the DW8 machines.

David_Powers
Inspiring
September 2, 2009

Adobe does not update older versions of Dreamweaver to keep pace with any change to third-party technology. So, you're whistling in the wind if you expect Dreamweaver 8, which was released in 2006, to be patched for PHP 5.3, which has only just been released.

As far as I'm aware, the only PHP code in CS4 that triggers warning notices is the XSL Transformation server behavior. If you run it in a PHP testing environment with E_DEPRECATED turned on, it produces a rash of deprecated warning messages. The temporary way to fix this in PHP 5.3 is to add this at the top of the page:

if (PHP_VERSION >= 5.3) {
  error_reporting(E_ALL ^E_DEPRECATED);
}

I have reported the problem to Adobe, and have been informed that the next release of Dreamweaver will have an updated version of MM_XSLTransform.class.php, which will be compatible with what is currently known of plans for PHP 6.

DwFAQ
Participating Frequently
September 2, 2009

Use an if/else statement in script so if PHP version is less than 6 show old code else show php 6 supported code.

info82Author
Known Participant
September 2, 2009

I am not an expert with Dreamweaver or with PHP.  Do you know how to modify the server behavior sode to add the IF/THEN clause?

DwFAQ
Participating Frequently
September 2, 2009

Sure just add this wherever you want to add a condition if php version is less than v.6

if (PHP_VERSION < 6) {
// something here
get_magic_quotes_gpc()
//other php code etc
}

Put whatever code between the if statement which will run the function if php version is before v.6 That way you can run the code in the php server before v.6 and when your server launches to php v.6 your site will be ready.

You could also append an else statement to the condition. More info is available here which was found as the first result when googling the term php if else

It's unlikely to expect support in Dreamweaver for an unreleased version of php. Unfortunately you may have to become an expert at php if you want support for unreleased versions. Just a thought. Best of luck!