When i tried to connect to Apache Cassandra server using the php code i got an error "Fatal error: Call to undefined function uuid_make()". I can find that PHP UUID extension was missing in PHP installation. Can anyone please suggest from where i can download the DLL file for PHP installation in my Windows 7 Machine.
Since there's no .dll file for the PHP UUID extension available online... you need to compile it from source. It shouldn't be too hard...
Download it here:
http://pecl.php.net/package/uuid
Follow the instructions here:
http://php.net/manual/en/install.pecl.windows.php
You can also install directly from PECL, instructions here:
http://wiki.php.net/internals/windows/stepbystepbuild
Unfortunately the PECL UUID extension is OS specific and will only work on Linux (including OS X) or Solaris.
On windows you have a couple of alternative options:
Check out com_create_guid (http://php.net/manual/en/function.com-create-guid.php) which is a Windows Only PHP function.
MySQL has a function called UUID (http://dev.mysql.com/doc/refman/5.5/en/miscellaneous-functions.html#function_uuid) which will generate a UUID, use something like "SELECT UUID()" as your SQL query. (I have not tested that this is available on Windows builds, if you do use it please post a reply to let everyone know how you got on)
If you are not worried about the uniqueness of your UUID (the reason for a UUID is to be as certain as possible that you won't generate two identical values ever in the lifetime of your application) then you could try some pure PHP implementation. It is not the most desirable solutions and I would never do this in production, but it might be enough for your needs - there are plenty out there on the web to use for inspiration.
Related
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
sorry if I seem like an absolute beginner at these things. I wanted to get the PHP extension for GEOS. I already have PHP (though XAMPP) and GEOS installed. Now, trying out the instructions on GitHub, I soon realize that these are instructions for Linux. I've been googling instructions for getting PHP extensions in Windows, but I've learned that it's not quite simple. Based on what I've found I would either need to
Use Visual Studio (which I would have to download first)
Find a dll (there is none)
Recompile PHP with the extension (not sure if I said it right)
So I have two questions: firstly, which of these options are most suitable for getting just one extension? And secondly, regarding the recompiling option, would I have compile things from a different source, since I got PHP from XAMPP and it doesn't seem to have the option to install the components separately.
EDIT: I believe that my question is not the same as this one because the user here actually found relevant DLLs, and did not have to compile anything or use Visual Studio.
I have tried using the printer methods but I get errors when whenever I use them. Have searched the web and the solution was to install the printer.dll file but I have failed to get this file.
forexample I get this for printer_list function
Call to undefined function printer_list()
How can I solve this.
Please refer to http://php.net/manual/fa/printer.installation.php
This » PECL extension is not bundled with PHP.
Windows users must enable php_printer.dll inside of php.ini in order to use these functions. A DLL for this PECL extension is currently unavailable. See also the building on Windows section.
You can find the currently available DLLs at
http://windows.php.net/downloads/pecl/releases/
Printer does not have an official release, but there is snapshot release available at
http://windows.php.net/downloads/pecl/snaps/printer/0.1.0-dev/
You need to find the right one for the PHP version you are using. As you can tell by the file names, these DLLs are for 5.3 to 5.5 - if you need it for a different PHP version, you need to build it yourself.
See, i'm trying to use OpenCV in Php, but i cannot find a proper way to do it. Neither in stackoverflow.
Over the internet, i found two different ways to try:
Using this git. https://github.com/mgdm/OpenCV-for-PHP
Problem: This code uses the dl function to import extensions on real-time execution , which has been removed from the last php versions (5.3 to 5.6 i think)
Solutions i've tried:
Link the extension .so at the php.ini file.
Problem: The code dosen't has any opencv.so file
Downgrade my php 5.6 to 5.2
Problem: Incompatibility with other parts of the code.
Using OpenCV Pecl package. http://pecl.php.net/package/opencv
Problem: The web shows the package but it has "no releases available". Neither if i try to download it on Centos using "(sudo) pecl download opencv". It gives me the same message, "no releases available. Download failed".
The thing is that i've seen a face-detection algorithm done with openCV over php, so i guess it is possible to use this library on Php. Anyone knows how?
Thank you in advance.
OpenCV has only C++ and Python implementation ,and its strictly machine vision library,However if you write "web service" say Json to interact with the machine vision script ,you can then access it via php client request.
image--->'json'--->python facedetect---->image--->'json'---->php
I'm using Ubuntu 12.04 LTS and needed PHP 5.4 so I'm using Ondřej Surý's (php5-oldstable) package.
Both phpinfo and the CLI show that JSON is enabled:
#php -i | grep -i json
json
json support => enabled
json version => 1.2.1
My application mostly works. But periodically (approx one page refresh in ten) there is a PHP error. This only happens intermittently.
PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525+lfs/json.so'
- /usr/lib/php5/20100525+lfs/json.so: cannot open shared object file:
No such file or directory "json.so"
How do I fix this?
I think that possible culprit (as I have answered in email) is that you are loading json extension somewhere from the configuration file.
The JSON extension is compiled in the core for PHP 5.4, so you should not load it by hand.
Please check that you don’t have:
json.ini somewhere in the /etc/php5/{mods-available} left over from previous PHP 5.5 installation
you are not loading JSON extension from the mentioned script, e.g. no dl(json.so).
Make sure you have stopped and started Apache2 (same applies to php5-fpm) when changing major versions. The symptoms might indicate that there was some stuck Apache2 thread with previous PHP from package loaded (that would be PHP 5.5 with json-c based JSON extension in this case).
Since you're saying that the json extension is loaded in phpinfo()'s output you could be dealing with a bug. Have you checked if the module file is actually there in the filesystem?
You have the following options:
Compile PHP 5.4 from source with Apache 2.4
Upgrade to the same repo's stable version which will give you PHP 5.5 + Apache 2.4.
Submit a bug with the Ondrej in Ubuntu's PPAs and wait for it to be resolved.
For more information check the debphp site.
Submitting a bug is a must, since if it is a real one it must be fixed for all users.
You could firstly go with option 2 if you don't conflict with the Migration guidelines like backward compatibility, deprecated functions, etc.. SO check it and decide.
It also strongly varies depending on the machine you have to do this with. If it is a critical production server, you may not want to compile of change versions on it. Go file the bug and see what the package maintainers have to say about this.
Also please write a reply here when your problem is resolved. I am quite curious as to what it is and hopefully was. :D
One point that doesn't diagnose or solve the issue (and seems to refer to PHP 5.5), but might help with tracing its root cause:
This Debian bug report and Phil Sturgeon's blog explain that some Linux distributions have chosen to replace the official PHP implementation of ext/json with the drop-in compatible pecl-json-c. The rationale was that Douglas Crockford's implementation contains a non-free clause in the license ("The Software shall be used for Good, not Evil"). See also this blog post.