Linking Lame.h with PHP extension - php

I'm trying to develop my first php extension. It uses Lame , so I've installed liblame-dev
lame.h is located at /usr/include/lame/
In my config.m4
LIBNAME=lame
PHP_ADD_LIBRARY($LIBNAME)
It builds, but something goes wrong at apache startup
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525+lfs/myextension.so' - /usr/lib/php5/20100525+lfs/myextension.so:
undefined symbol: lame_init in Unknown on line 0
SOLUTION
correct rows config.m4 for me, are
PHP_SUBST(MYEXTENSION_SHARED_LIBADD)
PHP_ADD_LIBRARY(mp3lame, 1,MYEXTENSION_SHARED_LIBADD)

Related

PHP Warning: PHP Startup: Unable to load dynamic library not working

I cannot for the life of me figure out what triggered this, and no other post seems to cover it. Can of youshed some light and help me resolve this matter? I am suing homebrew for my php. How can I go back to business as usual via php71 or greater? I am using a mac.
THE FOLLOWING IS THE ERROR:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/php71-intl/intl.so' - dlopen(/usr/local/opt/php71-intl/intl.so, 9): image not found in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/php71-intl/intl.so' - dlopen(/usr/local/opt/php71-intl/intl.so, 9): image not found in Unknown on line 0
PHP Warning: Module 'mcrypt' already loaded in Unknown on line 0
Warning: Module 'mcrypt' already loaded in Unknown on line 0
Configuration File (php.ini) Path: /usr/local/etc/php/7.1
Loaded Configuration File: /usr/local/etc/php/7.1/php.ini
Scan for additional .ini files in: /usr/local/etc/php/7.1/conf.d
Additional .ini files parsed: /usr/local/etc/php/7.1/conf.d/ext-intl.ini,
/usr/local/etc/php/7.1/conf.d/ext-mcrypt.ini,
/usr/local/etc/php/7.1/conf.d/ext-opcache.ini,
/usr/local/etc/php/7.1/conf.d/ext-xdebug.ini,
/usr/local/etc/php/7.1/conf.d/php-memory-limits.ini
So the short answer to this is, I ripped out Pear and pcel and anything else related to it I had just added, along with php71/Nginx and reinstalled php72/nginx (more os to be up to date as well), but once I symlinked it all restored to working form.
The real culprit here was pear, as I was originally trying to install xdebug, but pear/pcel took over my php setup and shit hit the fan!
We are no in a much better place, backtrace your steps like I did folks!

Changed PHP Version from 7.0.7 to 7.2.2 and back to 7.0 7 Now PHP is no longer working

I was testing an application to see if it would work in 7.0.7 and 7.2.2. The app works in both; that's not where the problem lies.
After seeing the app works in 7.2.2 I changed the Windows Apache httpd.conf file to:
LoadModule php7_module "C:/php_7_0_7/php7apache2_4.dll"
PHPIniDir "C:/php_7_0_7/"
from:
LoadModule php7_module "C:/php_7_2_2/php7apache2_4.dll"
PHPIniDir "C:/php_7_2_2/"
After changing the paths I restarted Apache.
Going to the URL localhost the webpage comes up correctly.
Going to localhost/phpinfo.php does not come up. The error message is "The site cannot be reached." The file phpinfo.php is simply <?php phpinfo(); ?>
The Apache error file has the following:
[Thu Feb 01 16:03:48.820715 2018] [core:warn] [pid 7628:tid 780] AH00098: pid file C:/Apache24/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
PHP Warning: PHP Startup: curl: Unable to initialize module\nModule compiled with module API=20151012\nPHP compiled with module API=20170718\nThese options need to match\n in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'php_fileinfo.dll' (tried: C:\php_7_0_7\ext\php_fileinfo.dll (The specified procedure could not be found.\r\n), C:\php_7_0_7\ext\php_php_fileinfo.dll.dll (The specified module could not be found.\r\n)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'php_gd2.dll' (tried: C:\php_7_0_7\ext\php_gd2.dll (The specified procedure could not be found.\r\n), C:\php_7_0_7\ext\php_php_gd2.dll.dll (The specified module could not be found.\r\n)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'php_intl.dll' (tried: C:\php_7_0_7\ext\php_intl.dll (The specified module could not be found.\r\n), C:\php_7_0_7\ext\php_php_intl.dll.dll (The specified module could not be found.\r\n)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'php_imap.dll' (tried: C:\php_7_0_7\ext\php_imap.dll (The specified procedure could not be found.\r\n), C:\php_7_0_7\ext\php_php_imap.dll.dll (The specified module could not be found.\r\n)) in Unknown on line 0
PHP Warning: PHP Startup: ldap: Unable to initialize module\nModule compiled with module API=20151012\nPHP compiled with module API=20170718\nThese options need to match\n in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'php_mbstring.dll' (tried: C:\php_7_0_7\ext\php_mbstring.dll (The specified procedure could not be found.\r\n), C:\php_7_0_7\ext\php_php_mbstring.dll.dll (The specified module could not be found.\r\n)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'php_exif.dll' (tried: C:\php_7_0_7\ext\php_exif.dll (The specified procedure could not be found.\r\n), C:\php_7_0_7\ext\php_php_exif.dll.dll (The specified module could not be found.\r\n)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'php_mysqli.dll' (tried: C:\php_7_0_7\ext\php_mysqli.dll (The specified procedure could not be found.\r\n), C:\php_7_0_7\ext\php_php_mysqli.dll.dll (The specified module could not be found.\r\n)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'php_openssl.dll' (tried: C:\php_7_0_7\ext\php_openssl.dll (The specified procedure could not be found.\r\n), C:\php_7_0_7\ext\php_php_openssl.dll.dll (The specified module could not be found.\r\n)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'php_pdo_mysql.dll' (tried: C:\php_7_0_7\ext\php_pdo_mysql.dll (The specified procedure could not be found.\r\n), C:\php_7_0_7\ext\php_php_pdo_mysql.dll.dll (The specified module could not be found.\r\n)) in Unknown on line 0
PHP Warning: PHP Startup: pdo_sqlite: Unable to initialize module\nModule compiled with module API=20151012\nPHP compiled with module API=20170718\nThese options need to match\n in Unknown on line 0
PHP Warning: PHP Startup: xsl: Unable to initialize module\nModule compiled with module API=20151012\nPHP compiled with module API=20170718\nThese options need to match\n in Unknown on line 0
PHP Deprecated: Directive 'track_errors' is deprecated in Unknown on line 0
When I use the command line and run php -i "print phpinfo();" -> delete.txt is run everything looks OK. The windows environmental variable path includes "C:\php_7_0_7"
This is the line that I thought would indicate trouble with the extensions:
extension_dir => C:\php_7_0_7\ext => C:\php_7_0_7\ext
That is the correct path to the extensions.
PHP Error Reporting is set to E_ALL (this is a development machine)
display_errors = On
display_startup_errors = On
When a file that is just phpinfo(); the site can not be reached. Running a file that uses the mysqli extension to connect to a database comes up with this error "Fatal error: Uncaught Error: Call to undefined function mysqli_connect() in C:\www\mysqli.php:8 Stack trace: #0 {main} thrown in C:\www\mysqli.php on line 8"
When phpinfo is run from the command line and saved to a file it includes the lines:
mysqli
MysqlI Support => enabled
Which makes me think that php from the command line is working and there is some configuration or communication between Apache and PHP that I'm missing.
The service for IIS is turned OFF.
Edit 1: using the built in server started on the command line with php -S localhost:8000 everything works! However I would like to use Apache as that is what the main shop runs. Plus the port :8000 at the end of local host breaks the site.
Edit 2: When httpd.exe is stopped as a service and started by double clicking on it, everything runs just like it should. Perhaps this means there is a permission conflict between the service and the directories.
Update: works. does not work.
Is there an error log that is created when PHP starts?
How do I go about troubleshooting this? I'm on my 2nd hour and I'm seeking advice.
Thanks for all suggestions.
I had a very similar issue after upgrading my php, apache, and mysql stack. Specifically, everything seemed to work but none of the modules were available and I was sure the extension path was correct. When checking the error log I noticed similar entries to yours with file names like php_php_{module_name}.dll.dll.
During this process I copied an old php.ini file which listed module names like so:
extension=php_gd2.dll
;extension=php_gettext.dll
but when comparing to the php.ini-development or php.ini-production files, all modules are listed like:
extension=gd2
;extension=gettext
Just in case there were other changes that I missed, I ended up just copying the proper example file php.ini-development|php.ini-production and editing it to fit my environment again but you can probably get away with just removing the php_ and .dll segments from each of the extension listings.
Hope this helps someone else.
hi5, encountered the same exact problem today. Seems like lower Apache versions (I had 2.4.18) does properly load curl and openssl extensions. There's also an issue with new php.ini extension format (notice no "php_" and ".dll"), white readme states legacy format is still supported).
What solved my issue with two non-breaking steps:
Updated WAMP 3.0.2 to 3.1.1 using this
Updated Apache to 2.4.29 using this
Don't forget to switch Apache version in WAMP menu after restart and use new extension format in php.ini

Php phpchartdir530 dll not found

I have a problem about php on centos. When I want to run php script I have problem like that below,
# php removespikes.php -R=/var/www/html/cacti-0.8.8a/rra/gyt_traffic_in.rrd
PHP Warning: PHP Startup: Unable to load dynamic library
'/usr/lib64/php/modules/phpchartdir530.dll' -
/usr/lib64/php/modules/phpchartdir530.dll: cannot open shared object
file: No such file or directory in Unknown on line 0
How can I fix this problem?

PHP Warning: PHP Startup: Unable to load dynamic library php_pdo_mssql.dll

Yesterday I reinstalled my windows and after installed Apache and copied PHP from dir.
And now I can not get access to PDO MS SQL Server.
In my php.ini ; is absent:
extension=php_pdo.dll
extension=php_pdo_mssql.dll
and in D:\Program Files\PHP\ext dll files is exsist.
When I call PDO script from browser I have this error: could not find driver.
In Apache error.log:
PHP Warning: PHP Startup: Unable to load dynamic library 'D:\\Program Files\\PHP\\ext\\php_mssql.dll' - \xcd\xe5 \xed\xe0\xe9\xe4\xe5\xed \xf3\xea\xe
0\xe7\xe0\xed\xed\xfb\xe9 \xec\xee\xe4\xf3\xeb\xfc.\r\n in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'D:\\Program Files\\PHP\\ext\\php_pdo_mssql.dll' - \xcd\xe5 \xed\xe0\xe9\xe4\xe5\xed \xf3\xe
a\xe0\xe7\xe0\xed\xed\xfb\xe9 \xec\xee\xe4\xf3\xeb\xfc.\r\n in Unknown on line 0
How can I fix this?
Thanks.

Error: Unable to load dynamic library 'C:\PHP\ext\php_sqlsrv.dll

I have tried all the options I could so far find regarding to .dll error but it has not been able to resolve my issue.
Please does any one have an idea of how I can get php to load these dynamic libraries. I am using php 5.3.18, IIS 7 and SQL ServerExpress database and each time i run the phh.info i get lots of error logs like these.
I also noticed that I do not have these .dll files listed in the 'ext' sub-folder that is in my php folder. Please let someone help so that i can move on. I would appreciate every contribution here
[19-Nov-2012 08:44:14 America/Denver] PHP Warning: PHP Startup:
Unable to load dynamic library 'C:\PHP\ext\php_msql.dll' - The
specified module could not be found. in Unknown on line 0
[19-Nov-2012 08:44:14 America/Denver] PHP Warning: PHP Startup:
Unable to load dynamic library 'C:\PHP\ext\php_pdo_sqlsrv.dll' - The
specified module could not be found. in Unknown on line 0
[19-Nov-2012 08:44:14 America/Denver] PHP Warning: PHP Startup:
Unable to load dynamic library 'C:\PHP\ext\php_pdo.dll' - The
specified module could not be found. in Unknown on line 0
[19-Nov-2012 08:44:14 America/Denver] PHP Warning: PHP Startup:
Unable to load dynamic library 'C:\PHP\ext\php_sqlsrv.dll' - The
specified module could not be found. in Unknown on line 0
[19-Nov-2012 08:44:14 America/Denver] PHP Warning: PHP Startup:
Unable to load dynamic library 'C:\PHP\ext\php_dblib.dll' - The
specified module could not be found. in Unknown on line 0
[19-Nov-2012 08:44:14 America/Denver] PHP Warning: PHP Startup:
Unable to load dynamic library 'C:\PHP\ext\php_curl.dll' - The
specified procedure could not be found.
I am wondering if that could be the reason why my dropdown is not able to populate from the database
The interesting thing here is that my connection script works fine but the dropdown does not populate and i dont get any error
if you don't have those files in that folder you need to put them there. Search your drive to locate if they are at a different location.
I was receiving this same error. I downloaded a Dependency Walker program from www.dependencywalker.com and found that the php_pdo_sqlsrv.dll couldn't find php5.dll because I didn't have my php files in my system path. I added the php install to my path and the warnings went away.

Categories