Viewed   161 times

I've installed PHP 7 using this repo, but when I try to run composer install, it's giving this error:

  • [package] requires ext-curl * -> the requested PHP extension curl is missing from your system.

With PHP 5, you can easily install it by running the yum or apt-get install php5-curl command, but I can't find how to install the PHP 7 equivalent.

How do I install ext-curl for PHP 7?

 Answers

4

Well I was able to install it by :

sudo apt-get install php-curl

on my system. This will install a dependency package, which depends on the default php version.

After that restart apache

sudo service apache2 restart
Sunday, August 21, 2022
1

no need to take shortcut of installing Wamp, i would suggest to install the Apache,MySql and Php stack individually.
I also came across this curl problem in wamp so i switched to installing them individually. you can follow these links with detailed description and slides to configure all three :-
1. Mysql
http://www.webdevelopersnotes.com/how-do-i/install-mysql-windows-7.php
2. Apache
http://www.webdevelopersnotes.com/how-do-i/install-apache-windows-7.php
3.Php
http://www.webdevelopersnotes.com/how-do-i/install-PHP-windows-7.php

This is one time process and is standard way to carry out things . You can also look into this(same for Win 7) :-
http://www.scribd.com/doc/11197274/Installation-of-Drupal-on-Windows-XP-using-Apache-Mysql-and-PHP

Hope it helps .

Sunday, October 16, 2022
 
raoul
 
5

GET requests do not have a body, that's the whole idea: you're just getting something from the server, as opposed to posting something to it. From RFC 7231:

A payload within a GET request message has no defined semantics; sending a payload body on a GET request might cause some existing implementations to reject the request.

In other words, a GET request can have data, but it should not. From earlier in the spec, where GET is defined as a safe method:

Request methods are considered "safe" if their defined semantics are essentially read-only; i.e., the client does not request, and does not expect, any state change on the origin server as a result of applying a safe method to a target resource.

...

Of the request methods defined by this specification, the GET, HEAD, OPTIONS, and TRACE methods are defined to be safe.

If you really want to have JSON in your GET request (and send it to a reasonably implemented server resource) the only place it can go is in the URI as part of the query string. For GET requests I find using file_get_contents to be much easier than dealing with cURL.

<?php
$payload = json_encode(["user" => $data]);
$url_data = http_build_query([
    "json" => $payload
]);
$url = "https://some.example/endpoint.php?" . $url_data;

$result = file_get_contents($url);

If you want to send it to an unreasonably implemented server resource, and violate the spirit of the HTTP RFCs, you could do this:

<?php
$url = "https://some.example/endpoint.php";
$payload = json_encode(["user" => $data]);
$ctx = stream_context_create(["http" => [
    "header"=>"Content-Type: application/json",
    "content"=>$payload
]]);
$result = file_get_contents($url, false, $ctx);

If you're determined to do this specifically with cURL, you might have luck with the CURLOPT_CUSTOMREQUEST option set to "GET" and CURLOPT_POSTDATA with your data.

Monday, December 26, 2022
 
2

Using some .dll file is not usual for a Mac system. Can you have a look at the folder /usr/local/Cellar/php70/7.0.27_19/lib/php/extensions/no-debug-non-zts-20151012/ to see if there is any other GMP related file? Probably, you should add the extension through

extension=gmp.so
Saturday, September 10, 2022
 
tapper
 
1

If you haven't solved this yet, I have a solution that worked for me. I'm on CentOS 7.x but it should still work for you, and anyone else wanting to use pecl-memcache with PHP 7 (not pecl-memcached as that's a completely different package).

As you have already discovered, you must use the Memcache PHP 7 port on GitHub for this.

Login to your shell and perform the following:

 1. wget https://github.com/websupport-sk/pecl-memcache/archive/NON_BLOCKING_IO_php7.zip
 2. unzip NON_BLOCKING_IO_php7.zip
 3. cd pecl-memcache-NON_BLOCKING_IO_php7
 4. /opt/cpanel/ea-php70/root/usr/bin/phpize && ./configure --enable-memcache --with-php-config=/opt/cpanel/ea-php70/root/usr/bin/php-config && make
 5. cp modules/memcache.so /opt/cpanel/ea-php70/root/usr/lib64/php/modules/
 6. echo 'extension=memcache.so' >/opt/cpanel/ea-php70/root/etc/php.d/memcached.ini
 7. service httpd restart

Some notes for the above:

  • Replace each full path that I've used with the appropriate full path on your own system. While I have /opt/cpanel/ea-php70/root/, you may have /opt/php-7.0.7/. If you have multiple PHP versions installed, as I do, running phpize may end up building using an old version of PHP. I discovered this after much trial and error.
  • To find out where your PHP modules folder is, you can run "/opt/cpanel/ea-php70/root/usr/bin/php -i | grep extension_dir"
  • You may not need to perform step 6 where I am creating a memcached.ini if you already have it loaded elsewhere.
  • You can verify if it was correctly built and installed using "/opt/cpanel/ea-php70/root/usr/bin/php -i | grep memcache". If you see various memcache entries, everything was installed successfully.

I hope that helps!

Monday, November 28, 2022
 
Only authorized users can answer the search term. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :