Asked  2 Years ago    Answers:  5   Viewed   84 times

I followed a guide which used home-brew to install the lastest version of php (5.4.8) on OSX Mountain Lion.

I then followed a guide which showed me how to setup and use the pre-installed apache on OSX.

However when I try running up a base Symfony 2 project I get a bunch of errors relating to missing date.timezone in the php.ini.

However I have this correctly setup the php.ini but doing a quick phpinfo() in the Symfony project shows that its using the old preinstalled version of php (5.3) rather than the new one.

In terminal if I type which php & php -v, It shows the correct new version is being used.

But the phpinfo() shows

 Answers

2

Did you follow all the instructions provided in the Caveats?

Run brew info php54 to see them again.

Especially the line:

To enable PHP in Apache add the following to httpd.conf and restart Apache:
LoadModule php5_module /usr/local/Cellar/php54/5.4.8/libexec/apache2/libphp5.so

Wednesday, December 14, 2022
 
boots
 
1

You need to make sure that the newly installed php command is executed, not the default one.

Add the folder where the correct php binary resides as the first item to the $PATH environment variable.

Saturday, December 24, 2022
 
2

You need to put any strings starting with @ in quotes:

arguments:
    ["@security.context", "@fos_user.user_manager"]

Reserved characters, like @, should be quoted. Unquoted @s were deprecated in Symfony 2.8. Symfony 3.0 will forbid you to use such definitions and will throw an exception.

If you don't have control over the bundle that registered the problematic configuration, send a pull request with a fix to the vendor. As a quick fix you can downgrade Symfony. 2.7 will work, as well as 2.8 (the later will only emit a deprecation notice).

Sunday, December 25, 2022
 
5

My Apache installation has these two lines in the httpd.conf file:

PHPIniDir "C:/Program Files/PHP"
LoadModule php5_module "C:/Program Files/PHP/php5apache2_2.dll"

Make sure that the directory in these Apache lines is the directory of the version of PHP you want.

You'll have to stop and restart Apache after you make changes to the httpd.conf file.

Monday, November 14, 2022
 
4

I ran into the same issue and found the following solution in the documentation: http://symfony.com/doc/current/book/testing.html#your-first-functional-test

To run your functional tests, the WebTestCase class bootstraps the kernel of your application. In most cases, this happens automatically. However, if your kernel is in a non-standard directory, you'll need to modify your phpunit.xml.dist file to set the KERNEL_DIR environment variable to the directory of your kernel:

<phpunit>
    <!-- ... -->
    <php>
        <server name="KERNEL_DIR" value="/path/to/your/app/" />
    </php>
    <!-- ... -->
</phpunit>

So check your phpunit.xml.dist configuration file and try to add the absolute path to your app-directory.

Hope it helps.

Tuesday, November 1, 2022
 
Only authorized users can answer the search term. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :
 

Browse Other Code Languages