IE, does PHP use its own, internal version of cURL or does it use whatever it finds in the local OS (Windows 10)? I'm in the unfortunate position of trying to make scripts written in 7.4 work on a permanent home that's saddled with 7.1. Before I force an update of PHP, I want to make sure chasing the right problem. I've searched php.ini and don't see a path to the local file system.
Thanks!
The curl functions in PHP do not call out to a command-line version of curl, but rather to a library which can be integrated into a C program.
This version may be included "statically" when PHP is compiled, be a separate file installed alongside PHP, or use a shared file installed centrally on the server and used by multiple programs. This will be determined by the distribution package of PHP.
To determine the library version used, use the phpinfo() function, or run php -i on the command line (which just runs that function for you) and search for "curl", which will show the version.
I'm not sure what your question is.
IE is not an issue here.
I always keep a script that gives me the current state of PHP.
PHP Manual, phpinfo()
<?php
phpinfo();
?>
phpinfo will return something like this if curl is (likely) installed.
I learned through the process of installing PHP 8.1 in my dev env and configuring it to use curl (and a comment), that PHP does call it's own curl executable, in the case of windows 10: php_curl.dll, and does not make an external call to curl in the operating system.
My fear was I'd go through the process of getting someone to upgrade PHP then have to have ask, again, to have curl upgraded.
Thanks to all who offered input!
yes, but curl is an extension, you need to enable it in php.ini file
Related
Is there a way to set the process title for a PHP script running under Apache (mod_php)? Typically, if I look at the output of top, I just see a bunch of copies of apache2, which is not usefull. I am using Ubuntu Linux in case that matters.
I have found the PECL proctitle extension, but it seems that it doesn't work very well. Plus, it's an extension, meaning I would have to get it installed, etc. I would prefer another way.
I also found the cli_set_process_title function, which seems to do what I want, but it only works in CLI mode. Is there an Apache version of this function?
I recently download PHP from here to install on Windows. I extracted all the contents of the file into a file called php located in C:\php. I added the path to the environment variables. I tried to run php -v on the command prompt but I get nothing, not even an error message. Am I missing something? Something wrong with the installation?
In order for PHP to be properly installed, I needed to have the Visual C++ Redistributable for Visual Studio 2012 installed. I did not have it installed but after all said and done I tried verifying if PHP is installed and it was.
Php is server side script that parses php code and return html output for your browser.
Get a web server and enable php. Try running php code on web server. point your browser to the location.
There are many free web servers available.
I am using php version 5.3 on media temple's grid server, however when I call a file using exec() the page is executing in PHP version: 4.4.9
The reason I am using exec() is to process the file in the background.
This is probably a simple question, but how do I manually set the PHP version to 5.3 for this file without using .htaccess?
Thanks.
The PHP interpreter you invoke via exec() is often a CGI version installed on the server as /usr/bin/php. You need to find out if a more contemporary version is available and then call the interpreter explicitly:
exec("/usr/bin/php-5.3 your-script.php &");
# or just adapt your scripts shebang #!/usr/bin/php5
(Just an example, the filename will be different. Also you can usually leave out the path. It's mostly just security relevant for setuid binaries.)
You might find out about other versions via print_r(glob("/usr/bin/php*")). But asking your hoster might be a better idea.
I've installed php on my computer without a server and running it using cli php curl isn't enabled and I don't have a clue how to do it.
In case someone comes across this thread and uses wamp server, here's a quick fix for the problem above http://forum.wampserver.com/read.php?2,47455
How use cURL library when running PHP through Command Line
you need first to install cURL
http://curl.haxx.se/docs/install.html
http://it.php.net/features.commandline [via Web Archive]
I have to set up curl on my windows 7 box for development. I've never had to use curl before so I'm lost on the install procedure. I've downloaded the binary executable and unpacked it. There is only the executable and no documentation. I can run the binary from the command prompt with no problems but where do I put this file?
Are there any other libraries that are required to use it with PHP? There is not much documentation on the curl site. Any help would be appreciated.
Also, something that has me a little worried is that I've uncommented the curl option in my php.ini file and when I restart Apache, Apache crashes. Why is this?
apache error 1067
I am not sure I understood your use use case completely, but looks like what you need is the libcurl.dll and not the curl executable itself.
PHP does not use the cURL standalone command line application, but libcurl. As such, you need to make sure php_curl.dll can be found by your PHP executable.