curl shows installed in phpinfo, but still get undefined function: curl_init - php

Summary: curl is installed, but I still receive this error attempting to use it:
[Mon Nov 14 16:39:05 2011] [error] [client 75.145.113.155] PHP Fatal error: Call to undefined function curl_init() in /.../htdocs/system/application/libraries/paypal/Paypal_pro.php on line 619, referer: http://example.com/buy/checkout
from phpinfo:
Additional .ini files parsed /etc/php5/apache2/conf.d/curl.ini
extension_dir /usr/lib/php5/20090626+lfs
I've confirmed both /etc/php5/apache2/conf.d/curl.ini and /usr/lib/php5/20090626+lfs/curl.so actually do exist.
Here is the content of curl.ini:
extension=curl.so
When I view the phpinfo file I created, it shows a section for curl, but the features entry there is blank. Is that normal? If not, what would cause that? I'm using bunut and installed curl with the following command as root:
apt-get install php5-curl
It worked with no error. I've restarted apache a few times with no effect. I've done this a variety of times on other systems, both Ubunut and RedHat without difficulty, so I have no idea what is going wrong here.

Related

laravel setup error: mbstring not found

I am just beginning with laravel. I followed all the steps mentioned in here: http://github.com/aimeos/aimeos-laravel and tried running the final project using this command:
php artisan serve
It is giving me an error:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/php_mbstring.dll' - /usr/lib/php/20151012/php_mbstring.dll: cannot open shared object file: No such file or directory in Unknown on line 0
Laravel development server started on http://localhost:8000/
[Wed Apr 13 17:03:32 2016] PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/php_mbstring.dll' - /usr/lib/php/20151012/php_mbstring.dll: cannot open shared object file: No such file or directory in Unknown on line 0
[Wed Apr 13 17:03:43 2016] 127.0.0.1:39822 [200]: /favicon.ico
[Wed Apr 13 17:03:43 2016] 127.0.0.1:39823 [200]: /favicon.ico
What should I do to resolve this error? I have installed mbstring library so I think it should've been able to find it.
I am using laravel 5.2.29.
EDIT:
I had uncommented the line:
extension=php_mbstring.dll
in my php.ini file which shouldn't be done if platform is UNIX. Now, when I run php artisan serve on terminal, it doesn't give any error. But when I go to localhost:8000, it says : Whoops! looks like something went wrong.
EDIT2:
Did everything according to suggestion.
Now the error is: No supported encrypter found. The cipher and / or key length are invalid.
What I have already tried:
'cipher' => 'AES-256-CBC',
php artisan key:generate
What can be done to resolve it?
Got my last problem resolved too.
The problem was that as #Bordon suggested, I had created a .env file. But when I ran the command:
php artisan key:generate
It created another file called .env.example. Now since I am a user of composer, I needed to rename it to .env (and remove the prev one).
So finally I renamed it, ran the above mentioned command again and now it works like a charm. Thanks a lot #Bordon for helping me out.
Also I would like to note that as #ash suggested, using Vagrant is quite a lot easier to me than xampp.

Bluemix PHP app fails on LDAP connection

This is a follow up ticket to one which was closed without answer:
https://stackoverflow.com/questions/34515574/ibm-bluemix-authentication-using-tivoli-ldap
I have migrated a PHP app which requires LDAP authentication to Bluemix and I am getting the following error:
2016-01-08T10:28:53.87+0000 [App/0] OUT 10:28:53 httpd | [Fri Jan 08 10:28:53.869250 2016] [proxy_fcgi:error] [pid 44:tid 139703240013568] [client 169.53.20.45:7120] AH01071: Got error 'PHP message: PHP Fatal error: Call to undefined function ldap_connect() in /home/vcap/app/htdocs/utils/LoginLDAP.Class.php on line 21\n', referer: http://sbrooms.w3ibm.mybluemix.net/index.php
Please note that this is not the public Bluemix, but the internal IBM one (w3ibm.mybluemix.net), hence the connection to the LDAP server should be available.
Do I have to explicitly request the connection to the LDAP server, or something else is going wrong?
Thanks,
Pimmy
Looks like the LDAP-Extension for PHP is not installed on the WebServer. The PHP message: PHP Fatal error: Call to undefined function ldap_connect() suggests that.
You can check that by adding a page to your webserver with the following content:
<?php
phpinfo();
Call that website in a webbroser and check whether there is any trace of the LDAP-extension. If not, you will need to get that extension. As there are many different ways to install it (from recompiling PHP to a call to your systems package-manager) I need more information on how your system - and especially PHP - has been installed.
Hope that helps!

Accidentally turn on SSL / HTTPS for phpmyadmin

I'm running Ubuntu 14.04.2 LTS, Apache 2.4.7, mysql 14.14, phpinfo.php
I was trying to reconfigure phpMyAdmin and I'm no longer sure what I actually did, because now all attempts to access the page result in a redirect to https, which doesn't work because my Apache server isn't configured to run SSL. I go to http://MYDOMAIN/phpmyadmin and it turns it into https://MYDOMAIN/phpmyadmin/?collation_connection=utf8_general_ci&SID which just has an SSL connection error.
I've tried uninstalling and reinstalling phpMyAdmin several times with no success.
If I go to http://MYDOMAIN/phpmyadmin/setup I get a blank screen but this line shows up in my weblogs:
[Tue Mar 24 05:09:10.518308 2015] [:error] [pid 8888] [client 50.161.45.55:49637] PHP Fatal error: Call to undefined function PMA_generate_common_url() in /usr/share/phpmyadmin/libraries/common.inc.php on line 352
I've tried creating and uncreating /usr/share/phpmyadmin/config/config.inc.php but it seems to have no effect.
Any ideas what I might have done and how I can revert back? mysql is still running fine and I'd rather not have to reinstall that.
Find phpmydmin's config.inc.php and change the line as follows:
$cfg['ForceSSL'] = false;

pdflib9.0.2 is not installing in my MAMP for php5.5.10

I am trying to install pdflib9.0.2 extension for my MAMP php5.5.10. I did the following steps.
Downloaded pdflib9.0.2 from http://www.pdflib.com/download/pdflib-family/pdflib-9/copied
created a folder "pdflib" in htdocs
found the extension_dir path from php.ini /Applications/MAMP/bin/php/php5.5.10/lib/php/extensions/no-debug-non-zts-20121212
copied /Applications/MAMP/htdocs/pdflib/bind/php/php-550/php_pdflib.so to /Applications/MAMP/bin/php/php5.5.10/lib/php/extensions/no-debug-non-zts-20121212
changed the permission to rw mode.
added extension=php_pdflib.so under "Dynamic Extensions" in php.ini
commented the following in /Applications/MAMP/Library/bin/envvars
#if test "x$DYLD_LIBRARY_PATH" != "x" ; then
# DYLD_LIBRARY_PATH="/Applications/MAMP/Library/lib:$DYLD_LIBRARY_PATH"
#else
# DYLD_LIBRARY_PATH="/Applications/MAMP/Library/lib"
#fi
#export DYLD_LIBRARY_PATH****
But I could not see pdflib in my phpinfo()
I tried to access /pdflib/hello.php and I see following message in my apache error log
client denied by server configuration: /Applications/MAMP/htdocs/pdflib/.DS_Store
client denied by server configuration: /Applications/MAMP/htdocs/pdflib/bind/.DS_Store, referer: http:///pdflib/
I dont know where is going wrong.
I saw this version map in the doc. So I dont think there is a version mismatch.
bind/php/php-530 for PHP 5.3.0 and above
bind/php/php-540 for PHP 5.4.0 and above
bind/php/php-550 for PHP 5.5.0 and above
Can anyone one find out the issue here. Any input will show me a new path to solve this issue.
Thanks in advance.
I have added my Apache2 error log and php_error_log and I guess either one or both of these may be the reason for my unsuccessful installation of pdflib. If I can get some information to move forward to fix the issue, it will be very useful. Apache Error log [Tue Apr 15 11:38:22 2014] [error] [client ::1] client denied by server configuration: /Applications/MAMP/htdocs/pdflib/.DS_Store
[Tue Apr 15 11:38:24 2014] [error] [client ::1] client denied by server configuration: /Applications/MAMP/htdocs/pdflib/bind/.DS_Store, referer: http:///pdflib/ php_error_log [15-Apr-2014 11:25:08 America/Los_Angeles] PHP Warning: PHP Startup: PDFlib: Unable to initialize module
Module compiled with build ID=API20121212,TS
PHP compiled with build ID=API20121212,NTS
These options need to match
Your php_error_log tells:
php_error_log [15-Apr-2014 11:25:08 America/Los_Angeles] PHP Warning: PHP Startup: PDFlib: Unable to initialize module
Module compiled with build ID=API20121212,TS
PHP compiled with build ID=API20121212,NTS
These options need to match
This means that the PHP you are using is compiled "non thread safe", the PDFlib module you use is the "thread safe" variant. In a "non thread safe" php you can only use "non thread safe extensions. Sou you need to install the extension from the "php-550-nozts_VS11" directory of the PDFlib package.

Ubuntu 11.10 PHP don't proceed

i've just setup a LAMP development environment on my laptop, all works fine except for php. Apache don't process PHP code embeded inside pages, and display no error. All php package seems to be correctly installed.
Testing a simple: <?php phpinfo(); ?>, give a blank page
error log give:
[Fri Mar 02 20:30:13 2012] [error] [client 127.0.0.1] PHP Fatal error: Unknown: Failed opening required '/home/lib/utils/setDocumentRoot.php' (include_path='.:/usr/share/php:/usr/share/pear') in Unknown on line 0
I finally solve my problem, it was due to a fix i've set in my virtualHost config (who was calling a missing file: setDocumentRoot.php), i've disabled that script and all works great.

Categories