suprajaj Posted August 12, 2012 Share Posted August 12, 2012 Hi I am just beginning to work with PHP on my internship. I am working with Piwik PHP API and want to call a PHP extension (PHP_FUNCTION) part of another directory structure (not belonging to piwik). Currently I am doing: chdir("/release/code/.../libs/php); include("name_of_file_containing_extension.c"); //call PHP_FUNCTION in the file But this does not work. Could someone pl tell me how to call this PHP_FUNCTION. Thank You Supraja J Quote Link to comment https://forums.phpfreaks.com/topic/266966-beginner-how-to-call-a-php-extension-in-another-directory-structure/ Share on other sites More sharing options...
MMDE Posted August 12, 2012 Share Posted August 12, 2012 error_reporting(-1); ini_set('error_reporting', E_ALL); Might help you figure out what is happening. Quote Link to comment https://forums.phpfreaks.com/topic/266966-beginner-how-to-call-a-php-extension-in-another-directory-structure/#findComment-1368727 Share on other sites More sharing options...
trq Posted August 12, 2012 Share Posted August 12, 2012 You used to be able to load extensions at runtime using the dl function, this functionality has since been removed from some sapi's You will need to load this extension when the server starts like all other extensions. Quote Link to comment https://forums.phpfreaks.com/topic/266966-beginner-how-to-call-a-php-extension-in-another-directory-structure/#findComment-1368729 Share on other sites More sharing options...
suprajaj Posted August 12, 2012 Author Share Posted August 12, 2012 The extensions are part of /libs/php - is that right or where are php extensions located usually. Then is this the right way to do it - http://files.zend.com/help/previous-version/Zend-Server-4-Community-Edition/adding_extensions.htm Thank you Quote Link to comment https://forums.phpfreaks.com/topic/266966-beginner-how-to-call-a-php-extension-in-another-directory-structure/#findComment-1368827 Share on other sites More sharing options...
trq Posted August 12, 2012 Share Posted August 12, 2012 The path to your extensions directory will be listed iwthin your php.ini. And yeah, that looks about right. Quote Link to comment https://forums.phpfreaks.com/topic/266966-beginner-how-to-call-a-php-extension-in-another-directory-structure/#findComment-1368867 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.