Quadropheniac90 Posted March 12, 2010 Share Posted March 12, 2010 Hi guys, I've been making an assignment for school using PHP. The problem here is that it works 100% perfect on my localhost but when I upload it to my remote server. The only difference I've noticed is that when I define a function in a variable like so: <?php$function = function($value) {echo $value;}?> That it works on my localhost, but not remotely. On the remote server I have to put the entire function as a parameter in the function I'm using to adress the function instead of just using $function as the parameter. If this information is not enough for you smart fellas to base a conclusion on I will send the files to anyone willing to help including the error_log of my remote server. Thanks in advance, guys. Link to comment Share on other sites More sharing options...
Andrew Posted March 12, 2010 Share Posted March 12, 2010 Run php_info() and check that everything matches, it could be that your host has different version / settings to your local development enviroment. Link to comment Share on other sites More sharing options...
Quadropheniac90 Posted March 12, 2010 Author Share Posted March 12, 2010 I ran the phpinfo() on both servers, but there's just way too much info to analyze. There are many differences though. The version on my localhost is newer than on my remote host. Link to comment Share on other sites More sharing options...
Andrew Posted March 12, 2010 Share Posted March 12, 2010 Ah, try and downgrade your local version to match the version on your host. Or ask if your host could upgrade their version of php. Link to comment Share on other sites More sharing options...
fred Posted March 12, 2010 Share Posted March 12, 2010 PHP has only supported anonymous functions (at least using that syntax) since 5.3. If you really need them for PHP < 5.3, there's always create_function() but that's rarely a sensible option. It'd be better to find a host that keeps their PHP up to date, or just use the standard syntax for named functions in your code. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now