This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

Symphony not seeing correct version of php

Discuss installing Symfony 2 here

Symphony not seeing correct version of php

by chicoHaze » Wed Apr 02, 2014 5:46 pm

I'm running through my first setup of Symphony2 on Max OS 10.8.5. Following the guide here;
http://symfony.com/doc/current/quick_to ... cture.html

I got as far server:run, eliminated a few errors but got stuck at this:
[InvalidArgumentException]
There are no commands defined in the "server" namespace.


The guide says that this is likely because I'm using PHP 5.3. The weird thing is that I actually have 5.4 installed. When I look at phpinfo() it shows I'm running PHP Version 5.4.24. However, when I look at php -v in the console, it shows I'm running 5.3.26.

Why would I show two versions of PHP running? I checked my Apache config and I have the php LoadModule line commented out, so it couldn't be the default install.

Alright, forget it. If Symphony thinks I'm running 5.3 I'll run through the "Configuring a WebSever" guide as recommended. I followed the instructions here:
http://symfony.com/doc/current/cookbook ... ation.html

but still no luck. http://localhost:8080 just gives me an "Oops! 404 error."

I'd really appreciate any suggestions anyone has to give. Thanks in advance.
chicoHaze
Junior Member
 
Posts: 1
Joined: Wed Apr 02, 2014 5:34 pm

Re: Symphony not seeing correct version of php

by denga » Fri Apr 04, 2014 3:26 pm

I had the same issue. In the terminal the php version shipped with mac os started. Run it with the complete path or change the path variable to get the mamp php file first.

.profile
Code: Select all
export PATH=/Applications/MAMP/bin/php/php5.5.3/bin:$PATH
denga
Junior Member
 
Posts: 4
Joined: Thu Apr 07, 2011 2:15 pm

Re: Symphony not seeing correct version of php

by Alan » Wed Apr 09, 2014 5:05 pm

Hi,

I have the identical problem on my Ubuntu.

I've installed XAMPP and while its phpinfo() shows PHP 5.5, php -v in console gives 5.3.10.

Can someone advise how to change PHP version being used by Smofony on Ubuntu?

Thanks!
Alan
Junior Member
 
Posts: 2
Joined: Wed Apr 09, 2014 4:56 pm

Re: Symphony not seeing correct version of php

by tiagojsag » Thu Apr 10, 2014 8:09 am

Hi,

In both cases, you have two versions of PHP installed.

For Ubuntu, I honestly don't understand why you would want to install XAMPP or anything similar. There are thousands of online tutorials on how to install Apache MySql and PHP using the included package manager. If you want bleeding edge, there are ppa's out there for that too. My advice is to remove XAMPP and use native packages.

For mac, my advice is to format your computer and use Ubuntu :P Seriously, mac ships with PHP 5.stone-age, and it's hard as hell to change it. I remember macports having a fully detailed tutorial on how to install Apache MySql and PHP 5.4 or 5.5. This tutorial is on the official macports wiki/support page, although it can be tricky to find. I'm sure you can also find something for Homebrew. You can also try MAMP, but I'm not sure that this will solve your problem.

In both cases, it's not a symfony problem, it's an operating system configuration problem, and I suggest you google it.

cheers
Tiago Garcia
@tiagojsag

Core Web Developer @ Shopware
http://www.shopware.de
User avatar
tiagojsag
Faithful Member
 
Posts: 885
Joined: Wed Aug 10, 2011 4:58 pm