I am running Symfony2, and have installed the FOSFacebookBundle for handling facebook connectivity. But after installing this bundle, I am not able to do
`assetic:dump` OR `cache:clear`
anymore, because this error is thrown up:
[Exception]
Facebook needs the CURL PHP extension.
I have checked, and the cURL extension is installed in my PHP (its in the .ini file, and the facebook connectivity also works on my website, but this error still shows up in the console when I try to run the above mentioned commands)
How do I solve this problem?
Php in console and your web server use different php configurations. Use -c flag to
specify the php config file or just create/edit php.ini in php bin folder:
php -c "/path/to/php.ini" app/console
Related
i AM USING A aws lightsail instance with a Bitnami Apache2 Lampstack setup on it.
My issue is I am unable to get php curl enabled. I seem to have a bunch of php.ini files all over the server in diffiferent locations. So I edited all of them removing the ; from the line that read extension=curl. I then restarted the instance. However my php file is still giving me the error saying
caught Exception: Shippo needs the CURL PHP extension.
When I run a phpinfo() I see my path to the ini file is /etc/php/8.0/apache2/php.ini
However when I do a which php command I am giving a path like this /opt/bitnami/php/bin/php
when I do a php -v I am also seeing it say PHP 7.4.27 so my php info file seems to say I am using php7.8 and my CLI feels i am using php7.4 which could be part of my issue.
Any suggestions on how to fix this? my other issue is I am having a hard time getting to the path /etc/php/8.0/apache2/php.ini I simply can not find a folder with 8.0 in it
When I try to use the sample code:
$fp = fopen("gs://my_bucket/some_file.txt", "w");
fwrite($fp, "Hello");
fclose($fp);
I get this error:
Warning: fopen(): Unable to find the wrapper "gs" - did you forget to enable it when you configured PHP?
UPDATE
Switching to running the app server from the command line made the original error go away but I now get this error:
'google\appengine\runtime\RPCFailedError' with message 'Remote implementation for urlfetch.Fetch failed'
Does anyone know how I can resolve it?
Where are you seeing this error? On the production server, testing locally using our SDK or are you not using the SDK?
We install this handler as part of our setup script, so you need to be running in the dev appserver if your testing locally.
You have to use dev_appserver.py (from GAE PHP SDK) to check your code locally. Do not run it through your local webserver, since it will not provide additional plugins (for example gs: stream support) and won't emulate "whole" GAE environment (Datastore, Memcache, Tasks etc.).
On Debian following should work:
sudo apt-get install php5-cgi
/path/to/google_appengine/dev_appserver.py --php_executable_path=/usr/bin/php-cgi .
assuming that:
you have downloaded and installed GAE PHP SDK
you're in your GAE test application directory
You will have to enter localhost website on port 8080 to check if you have your app working. On localhost port 8000 you have admin server in which you can check data in your local Datastore.
After that you can place phpinfo() in your .php file to check if you have 'gs' supported in "Registered PHP Streams" row.
Using "file_put_contents" instead of "fopen" fixed the problem for me.
Thanks
As the error suggests, the wrapper i.e. 'gs' is undefined.
Their are some build-in wrappers by php that can be used in fopen php function; for the custom wrappers i.e. 'gs' in your case, stream_wrapper_register php function can be used.
Reference links:
http://www.php.net/manual/en/wrappers.php
http://www.php.net/manual/en/function.stream-wrapper-register.php
trying to enable curl in xampp 3.0.12 in windows environment.
Updated the php.ini in the php folder to enable curl, and there is no php.ini file in the apache/bin folder.
phpinfo() says:
loaded configuration file: C:\xampp\php\php.ini
curl support:enbaled
curl information: 7.24.0
and when i try to run a http_get() command php says:
Fatal error: Call to undefined function http_get()
Restarted both windows and xampp several times to update the changes.
Would be grateful for some advice, as I searched through similar topics on the web but can't get any further.
Note that the function http_get() belongs to the pecl http extension and not to the curl extension. Refer to the documentation of the curl extension to learn how you can use it to retrieve documents via http. You'll also find a lot of posts on stackoverflow
Also note, that the function file_get_contents() can be used to get documents over http in a very simple way. Although it is limited it will fit in much cases. To retrieve a page you can issue:
file_get_contents('http://www.server.com/page.html');
I am trying to make PHP5 work over IIS 6.0 on Windows server 2003 and i am following this steps:
http://www.iisadmin.co.uk/?p=4
The thing is, there's no file named "php5isapi.dll" inside the php folder, so I am using php5isapi.dll instead. Is it correct? Or should I try to download the php5isapi.dll from somewhere.
Well, then, I keep following the steps and when I try to execute my php file, I get this message:
The specified procedure could not be found.
What am I doing wrong?
Thanks.
UPDATE
I downloaded php5isapi.dll and tried to make it work with it but i am getting this error:
The specified module could not be found.
Also, after any change, i restart the Default Web Site clicking on stop and play.
UPDATE 2
Now, after rebooting, when trying to access the PHP file, the browser shows a 500 error:
The page cannot be displayed
I noticed that "php5isapi.ll" is no longer available for the last versions of PHP as pointed in here:
Why is php5isapi.dll missing after installing PHP for Windows?
Therefor, what i did was following this tutorial in order to do it with FastCGI
http://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/using-fastcgi-to-host-php-applications-on-iis-60
I found it on this comment:
Why is php5isapi.dll missing after installing PHP for Windows?
After restarting the server, it finally worked.
I am currently moving my web app to amazon ec2. Since it's only for testing, I use the free version called ec2 free tier with windows server 2008 instance. However, Although I have done all I know and read this thread ( How to enable cURL in PHP / XAMPP ). I just couldn't use curl on my php script. it always creates the error
Call to undefined function curl_init() in C:\xampp\htdocs\index.php on line 2
Here are all thing I have tried
Install Wamp ( I tried it on XAMPP to)
Uncomment out php_curl in php.ini file ( and restart apache)
Copy two dll files to both system32 and syswow64
Could it have to do with the fact that I am using free vps?
Update:
Also, when I started the apache server in XAMPP , this error appeared
'PHP Startup: unable to load dynamic library curl.dll'
However, I have double checked the ext directory and the php_curl.dll was in there.
i think curl need to access remote sever from our web server. so i opened all traffic in my server outbound rule and it works. i think this is not good solution. still look for better way.
nope.
be sure, that you have the files in the right place, usually its in the plugins folder for php! maybe you cann add a absolute path to your php.ini!
be sure, you edit the correct ini file!
php completly independent to your operatingsystem!
just be sure to doublecheck everything. because its not saying, it has trouble loading your extention, its just saying, the function your trying to call, is not there. so i assume your extention ist not loading at all! :)
One reason I did notice for this cURL plugin to malfunction was the availability of copies of libeay32.dll and ssleay32.dll files. Please check whether your system32 folder has such copies and if so, please rename them to some other names and copy the ones found with the php installation. Sometimes you may need to restart your machine. This was documented here some time ago.
I had a similar problem, but it occours just with requests under https. I tried to create a curl request directly from the ec2 machine and got a error: "curl: (77) error setting certificate verify locations".
It looks like some kind of ssl validation fail because of a certificate not found. So I used a parameter -k (or --insicure) in my curl command, to ignore this validation and after that my curls request did directly from ec2 machine worked.
So I tried to apply a similar ideia in my curl command in php, (I suppoused that the curl php extension forward this requests to the operation system) and I found this curl opt:
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
After that it works to me.
Probably this isn't the best way to solve the problem, but solved my problem temporarelly.