xapian on CentOS 6 with PHP 5.3+ - php

I've got a 64bit server with CentOS 6 and PHP 5.3 installed
php-5.3.2-6.el6_0.1.x86_64
I've installed xapian using RPMs from their website
rpm-eprints-org-xapian-6-1.noarch
xapian-bindings-php-1.2.7-1.x86_64
xapian-core-libs-1.2.7-1.x86_64
xapian-bindings-1.2.7-1.x86_64
xapian-core-1.2.7-1.x86_64
Now when I try to use the xapian library from PHP through Apache, I get this error:
Call to undefined function dl() in /usr/share/php/xapian.php on line 22
After some Googleing I found that dl() is no longer working in PHP 5.3+. I've enabled enable_dl in php.ini, didn't do anything. I've not been able to find any solution to this problem anywhere. I guess there aren't many people using CentOS 6 at the moment?
What can I do?

Since the xapian-bindings are a PHP-extension you could just load it by adding the following to your php.ini:
extension = xapian.so
Btw. the dl-manual says that dl is just disabled for certain "SAPIs" (and apparently mod_php is one of them).
One alternative would be to try php-cgi.

Related

Magento2 setup error stating i need to change php.ini setting but it is already set

I am trying to set up a Magento 2 app.
I keep getting an error like this:
Your PHP Version is 5.6.31, but always_populate_raw_post_data = 0.
$HTTP_RAW_POST_DATA is deprecated from PHP 5.6 onwards and will be removed in PHP 7.0.
This will stop the installer from running. Please open your php.ini file and set always_populate_raw_post_data to -1.
If you need more help please call your hosting provider.
First of all I have 3 dirs: PHP5.6.31, PHP7.0.23, PHP7.1.9.
So in the PHP 5.6.31 i have 3 ini files all of witch have this setting.
always_populate_raw_post_data to -1
The other 2 folders PHP7.0.23, PHP7.1.9 don't have this in the php ini because it is newer version of php. My question is what can i do to resolve this issue if the php ini does have the correct settings but the install says otherwise?
Well Magento 2.1.11 does not support PHP 5.6.31, but only from 5.6.4 and upper.
Have a look here.
So, try first running
which php
to see which version it is trying to use, then either you can uninstall the 5.6 version and (better) use the php7 version, or be sure it is using the proper one.
Hope it helps.

Class 'NumberFormatter' not found in Laravel 5.4

I'm trying to use PHP's intl extension to convert amount into words. For example,
1450 -> One Thousand Four Hundred and Fifty
I'm using Laravel 5.4 that runs on XAMPP 3.2.2 server with PHP 5.6.24.
As mentioned in similar questions, I've already enabled the intl PHP extension by uncommenting the line as extension=ext/php_intl.dll in PHP.ini file and restarted my server after.
$inWords = new \NumberFormatter('en', \NumberFormatter::SPELLOUT);
echo $inWords->format(1450);
yields the error:
FatalErrorException: Class 'NumberFormatter' not found
I'm guessing this doesn't have anything to do with Laravel but PHP. Anyone know the solution to the problem? Thanks for your time.
You have to enable the extension in your php.ini by uncommenting the line
;extension=php_intl.dll
You need to use
use \NumberFormatter;
At controller

"Fatal Error: Call to undefined function mb_detect_encoding()" when trying to run phpMyAdmin 4.2.7 on IIS 8 with PHP 5.4.30

I have PHP 5.4.30 installed and running well using the FastCGI module and IIS 8 (on Windows 8.1). I have MySQL installed and would like to manage it with phpMyAdmin, however, I get this error whenever I try to access the page:
Fatal error: Call to undefined function mb_detect_encoding() in C:\inetpub\wwwroot\phpmyadmin\libraries\php-gettext\gettext.inc on line 177
Many older threads I have seen suggest adding extensions to the php.ini, but in the later versions of php, the php.ini file becomes php.ini-production and php.ini-development. Whenever I try to modify either of these files or create a php.ini file, I get an error 500 when trying to visit other php pages. I have also seen many solutions related to Xampp / Apache, but none of them seem to work in IIS 8 (that I have found).
Thanks in advance for any suggestions!
You probably need the php_mbstring.dll file installed. You can find it on the PHP Windows Extensions page

Class 'Memcache' not found & PHP

I installed memcached by reading this article on Windows7 but unfortunately i keep getting error Fatal error: Class 'Memcache' not found in D:\xampp\htdocs\test\memcache\test.php on line 2
Line 2: $memcache = new Memcache;
Win7 64, Xampp Installed. I am using net start "memcached Server" on command line but it says service is already started.
Some other info which may help;
On php.ini file:
extension=php_memcache.dll
[Memcache]
memcache.allow_failover = 1
memcache.max_failover_attempts=20
memcache.chunk_size =8192
memcache.default_port = 11211
Update: phpinfo(); show dll is not loaded. Tried several different dll files so far, didn't work. Also dll is located correct. It is in the right folder as it seems.
(P.S. Some may think there are possible duplicates about this topic but there is only 1 person who followed the same instructions and had same error in SO. That question has no answer or solution since march.)
I found the working dll files for PHP 5.4.4
I don't knowhow stable they are but they work for sure. Credits goes to this link.
http://x32.elijst.nl/php_memcache-5.4-nts-vc9-x86.zip
http://x32.elijst.nl/php_memcache-5.4-vc9-x86.zip
It is the 2.2.5.0 version, I noticed after compiling it (for PHP
5.4.4).
Please note that it is not 2.2.6 but works. I also mirrored them in my own FTP.
Mirror links:
http://mustafabugra.com/resim/php_memcache-5.4-vc9-x86.zip
http://mustafabugra.com/resim/php_memcache-5.4-nts-vc9-x86.zip
Add this to your php.ini:
extension="php_memcache.dll"
and restart apache
Memcached just uses standard text interface so its possible to use it without the module.
// connect
$link = fsockopen($host,$port,$errno,$errst,$timeout);
// set
$data = sprintf("set %s 0 %s %s\r\n%s\r\n",
$key,$expire,strlen($value),$value);
fwrite($link,$data);
$result = trim(fgets($link));
if ($result == 'ERROR') {
// :(
}
// get
$data = sprintf("get %s\r\n",$key);
fwrite($link,$data);
$line = rtrim(fgets($link));
if ($line != 'END') {
return rtrim(fgets($link));
}
So i have looked now for a solution. Here you can download some compiled extensions.
http://downloads.php.net/pierre/
The problem is that at the moment there is no memcache extension for PHP 5.4. this is the problem why your extension could not be loaded. You need the extension for the correct PHP version and Tead Safe for Windows.
So the easiest way is to work with PHP 5.3 if you need the extension.
The newest version of memcache is the version 3.0.6 but its a beta version you can see it here.
http://pecl.php.net/package/memcache
You could try to take the beta version and compile it with your windows system. But its a lot of work.
Also problem can be in loading another version of php module somewhere in apache .conf files. Need to check duplicated "LoadModule php..." directives and if that module compiled to correct version of apache.
It seems sound simply, but not when you have several versions of php on one machine :)
Or it can be SElinux problem too.
xampp windows version is 32bit ,you must be use 32bit memcache.dll
I hole that would be useful for you!

Problem installing cake php

I have installed wampserver on my pc. I unzipped the cake php installation files in the "www" folder of wampserver. Now, when I try to run- "http://localhost/cakephp", I get a whole list of errors along with the cake php getting started page. Here are some of the errors:
Deprecated: Assigning the return value of new by reference is deprecated in
D:\wamp\www\cakephp\cake\libs\inflector.php on line 131
Deprecated: Assigning the return value of new by reference is deprecated in
D:\wamp\www\cakephp\cake\libs\configure.php on line 136
Deprecated: Assigning the return value of new by reference is deprecated in
D:\wamp\www\cakephp\cake\libs\configure.php on line 226
Deprecated: Assigning the return value of new by reference is deprecated in
D:\wamp\www\cakephp\cake\libs\configure.php on line 906
How do I fix this? I got similar errors for codeignite.
Which version of PHP are you running ?
To get E_DEPRECATED errors, it must be PHP 5.3 (which is quite recent) -- and I think the last version of WampServer uses this one.
See :
Predefined Constants
PHP 5.3.0 Release Announcement
As it's pretty recent and brought lots of new stuff, you might run into some kind of troubels (you actually did) with PHP 5.3.... Especially if the software you used is not compatible with it yet.
You might want to downgrade to the previous version of WampServer...
Or you could try lowering the error_reporting level (see also error_reporting), to not get those warnings.
But if you are getting those, you'll probably run into other problems as well...
Actually, after a rapid search into CakePHP's Trac, I found at least those :
Ticket #6026 : php 5.3 needs error_reporting(E_ALL & ~E_DEPRECATED);
Ticket #6500 : PHP 5.3 incompatibility
None of those is solved... So it seems CakePHP is really not ready for PHP 5.3... (It's probably not the only Framework in this situation btw -- Zend Framework v 1.9 which went out couple of days ago is the first version that officially supports PHP 5.3, for instance)
If you want to work with CakePHP, so, you'll probably have to use PHP 5.2.x (like 5.2.9 or 5.2.10).
You're actually not the only one in your situation, it seems... Too bad, as there are pretty nice things in PHP 5.3...
hi I faced the same problem. I have easyphp installed and the latest easyphp is also using php version 5.3. I downloaded cakephp stable version : Release: 1.2.4.8284 Stable. When i opened the web page, i also got the same 'depricated' notices. I also tried mangling with the 'error_reporting' section with no luck.
As I didn't want to downgrade my php 5.3 to an earlier version, I tried CakePHP 1.3-dev. And the problem was fixed.
I am also having the same problem.....I downgraded wamp5 2 to wamp 1.6.0...Now its working perfect
I had similar issue and I installed the 1.3.0-beta and the problem went away...
e
I tried one solution given by Pascal:
https://trac.cakephp.org/ticket/6026
applied this patch and in my case this helped. Thx
I had also same problem but I got resolve by changing in httpd.conf and php.ini
My changes are here-
in httpd.conf
replace
#LoadModule rewrite_module modules/mod_rewrite.so
to
LoadModule rewrite_module modules/mod_rewrite.so
and in tab Directory "{yourdirectoryname}:/wamp/www/">
replace
Order Deny,Allow
Deny from all
to
Order Allow,Deny
Allow from all
in php.ini
make curl ext on. there is no need to run but you should do :)
extension=php_curl.dll
My server and php configuration was
Apache Version : 2.2.17, PHP Version : 5.3.4

Categories