PHP Developers Network
http://forums.devnetwork.net/

Using different PHP versions between dev platforms
http://forums.devnetwork.net/viewtopic.php?f=72&t=145480
Page 1 of 1

Author:  neo2810 [ Sat Jan 13, 2018 5:43 am ]
Post subject:  Using different PHP versions between dev platforms

Ok, bear with me, I'm not sure if this is the right forum to ask but here goes... I've been using PHPStorm happily for a while on a single custom project (PHP framework contained in single project folder connecting to a live hosted DB defined by a local config file). This is all nicely integrated with Github and works a treat, however, it's using PHP v5.6 (the framework doesn't support higher).

I want to develop a new site based on Laravel and have installed Xampp, popped the Laravel framework into the htdocs folder, and set up Apache and the Mysql DB. I've configured the PHPStorm project settings to use PHP7.0 (native in Xampp).This is all fine and I can navigate to localhost and I see the Apache front page. Navigate to localhost:port and I get the PHP framework homepage, but as soon as I try and run the website install, I get encryption errors.

Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR) - Call to undefined function Illuminate\Encryption\openssl_cipher_iv_length()

I know I need to install composer and some other dependancies but as soon as I try from terminal, it tells me the package requires PHP >=7.0 and I'm running 5.6! So although the project settings are correct in PHPStorm at 7.0, my system has 5.6 as native and I can't seem to get past that. I don't want to change to 7.0 and remove 5.6 because I still need to work on the older site while I develop the new but I don't know how to get this working so the new project sees 7.0 when I install composer and run dependency upgrades.

Does that make sense?

I did try and set a PATH variable to the PHP7 folder as well as the current 5.6 but that appeared to break the old site so I'm nervous about changing anything I'm not sure about...

Anyone have a similar setup or experience?

Author:  Christopher [ Sat Jan 13, 2018 11:42 pm ]
Post subject:  Re: Using different PHP versions between dev platforms

Do you have your php_openssl.dll extension enabled in php.ini ? It probably needs a function from that library.

Author:  neo2810 [ Sun Jan 14, 2018 10:55 am ]
Post subject:  Re: Using different PHP versions between dev platforms

Yeah, it's enabled in the 7.0 ini, but the problem is that terminal is trying to use the 5.6 version...

Author:  neo2810 [ Sun Jan 14, 2018 11:21 am ]
Post subject:  Re: Using different PHP versions between dev platforms

Lo and behold, just after posting the above, I enabled openssl in the 5.6 version and the site is working now, but displaying that it's using the 7.1.3 version as it should be. Bizarre...

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/