0

My server is running php-fpm with nginx. I had applied these permissions.

sudo chgrp -R www-data /usr/share/nginx/html
sudo chmod -R g+rw /usr/share/nginx/html
sudo chmod g+s /usr/share/nginx/html

I have this code.

if(function_exists("my_void_function")){

    echo "exist";

}else{
    echo "none exist";
}

I am getting different result that simple code. you can see screenshot of my pc from this image.

php different result terminal and browser

3
  • Is the function name really my_void_function? Commented Nov 8, 2014 at 23:01
  • Yeah. i added via custom php extension. Commented Nov 8, 2014 at 23:02
  • That explains it. See answer below. Commented Nov 8, 2014 at 23:06

1 Answer 1

1

As you have added the function via a custom extension, you must load the extension with the respective php.ini file of the PHP engine. PHP CLI has a different php.ini than PHP-FPM/mod_php.

Also, after changing php.ini of PHP-FPM, you must restart the PHP-FPM service (usually sudo service php-fpm restart on Debian-like systems). Those who are using mod_php with Apache need to restart the Apache service.

Sign up to request clarification or add additional context in comments.

1 Comment

thank you for your helping. I just added same ini file under /etc/php5/fpm/conf.d

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.