I am trying to install phpredis to work with my php.
But the thing is, every time I try to get it to work, my error_log sends this error:
[code]PHP Fatal error: Class 'Redis' not found in /var/www/html/testme.php on line 5[/code]
I have downloaded the source code from http://github.com/owlient/phpredis
and then
phpize
./configure
make && make install
but still not working.
What can I do now?
specifically, created a redis.ini:
$ cat /etc/php5/apache2/conf.d/redis.ini
;configure the redis module
extension=redis.so
I filed a github issue, hopefully they'll make it create the ini automatically, or at least explain in the install instructions:
https://github.com/owlient/phpredis/issues/94
I got it to work.
I had to give the full path in php.ini, restarted httpd and voila it works :D
Related
We have setup running Phabricator in one of our servers. Today I upgrade it by following the standard steps given in "https://secure.phabricator.com/book/phabricator/article/upgrading/" upgrade note.
When I try to start pdh using systemctl start phabricator-phd it get fails.
Error is
ERROR: Unable to load libphutil. Update your PHP 'include_path' to include the parent directory of libphutil/.
I tried other different way to start it but all of the giving this same error.
Hope someone can help me to solve this issue.
in the folder where arcanist/ is
git clone https://github.com/phacility/libphutil.git
This solved my problem.
Using git clone https://github.com/phacility/libphutil.git like #Youngjae Ji recommends doesn't work anymore. Take a look at that repo now. There's nothing in it! https://github.com/phacility/libphutil. A work-around seems to be the following, however:
sudo apt install libphutil then dpkg -L libphutil to see where it's located on your system. Once you find out where it is (ex: /usr/share/libphutil), symbolically link to it in arcanist as follows: ln -s /usr/share/libphutil path_to_arcanist/externals/includes. Now it should work.
Typically phd is restarted via bin/phd restart. Does this work? If yes, then the issue is your startup script. If no, then Phabricator likely wasn't installed correctly.
Fixed.
It was a permission issue. below fixed it.
chmod g+rX,o+rX libphutil/ -Rc
chmod g+rX,o+rX arcanist/ -Rc
chmod g+rX,o+rX phabricator/ -Rc
I have met the same problem.One way to solve: just put libphutil, arcanist, phabricator(the websever started) on same path
I'm trying to install libinjection from here
I'm trying to install the PHP module but I'm getting this error after make, make install, make test:
2/libinjection.so - /usr/lib/php5/20121212/libinjection.so: cannot
open shared object file: No such file or directory in Unknown on line
0 PHP Notice: Use of undefined constant LIBINJECTION_VERSION -
assumed 'LIBINJECTION_VERSION' in
/home/mohammed/libinjection/php/example.php on line 6
Using libinjection LIBINJECTION_VERSION PHP Fatal error: Call to undefined function new_libinjection_sqli_state() in
/home/mohammed/libinjection/php/example.php on line 9
In php.ini I added
extension=libinjection.so but I'm still getting the error.
Any advice?
Based on the error message
/usr/lib/php5/20121212/libinjection.so: cannot open shared object
file: No such file or directory
When you ran make install it did not install the extension to the path where PHP is looking for it.
Find where it installed the extension to, and copy libinjection.so to /usr/lib/php5/20121212 and then restart the web server (Apache, nginx etc) and try running your code again.
To build an extension in PHP,
you first need to run scripts/phpize in the PHP folder,
and ./configure with a prefix to find the correct folder.
Simply using ./configure && make && make install is not enough.
chmod +x /usr/local/src/php-5.6.9/scripts/phpize
/usr/local/src/php-5.6.9/scripts/phpize
./configure --prefix /usr/local/src/php-5.6.9 \
--with-libdir=/lib/x86_64-linux-gnu \
Use ./configure --help to get available options.
I installed node.js from sources (./configure && make && make install) under /usr/local/bin/node. Afterwards I installed the less compiler globally with npm -g install less under /usr/local/lib/node_modules/less/. So node and less are located under their default paths.
I am using kriswallsmith/assetic to compile my less files through PHP, therefore I adjusted path to /usr/local/bin/node. Everytime I run my script I get the error Error: Cannot find module 'less', I had the same behavior through command line. But I found a solution (ln -s /usr/local/lib/node_modules/ ~/.node_libraries) to fix the problem and after this it worked out on command line. Through PHP the problem still persists - PHP is running through FastCGI with the same user I used on command line.
How can I fix this problem through FastCGI/PHP too?
Constructor of assetic's LessFilter accepts an array of nodePaths. Adding /usr/local/lib/node_modules/ as a nodePath solves the problem.
I've already installed the RabbitMQ on my server and everything is working fine with it. I already tried to send and receive queued messages with a Java client and everything went perfect.
Now I need to install a PHP RabbitMQ client because I want to communicate a Java program with a PHP webpage, but this time I'm not beign so lucky.
I already followed the steps of the official webpage for this installation, specifically these steps:
# Download the rabbitmq-c library
hg clone http://hg.rabbitmq.com/rabbitmq-c/rev/3c549bb09c16 rabbitmq-c
cd rabbitmq-c
# Add the codegen requirement
hg clone http://hg.rabbitmq.com/rabbitmq-codegen/rev/f8b34141e6cb codegen
# Configure, compile and install
autoreconf -i && ./configure && make && sudo make install
And actually on the console I can see that it was "installed" without any problems. But when I try to open any AMQP Connection I get this error:
Fatal error: Class 'AMQPConnection' not found
Actually if I use the phpinfo(); command I can't see anything related to an AMQP module (like in this question). So I think that it may be a problem with the installation but I tried reinstalling it two times and it keeps saying that everything went well.
Have anyone crossed with this problem too?
Solved it..
The module wasn't being loaded in the right php.ini file. Just added extension=amqp.so at the end of the right php.ini file and restarted Apache.
Ok, I think before I start I should just say that I'm a complete n00b when it comes to topic of OSX/BSD. I've only had my MBP for the past week or so and have been learning HEAPS. Though, despite this, I'm still trying to wrap my head around a few things, so, please, be gentle. :)
Alright, on to my problem. I've been trying to setup my local development environment now for a few days. I have activated Apache 2.2 and PHP 5.3.3 which came with the OS. I have also manually installed MySQL, Homebrew and setup BIND (for easier vhost management). Everything appeared to be working quite well until I realize I had to also install PEAR.
Unfortunately, a lot of critical areas within my company's products rely heavily on the PEAR library, so I had to make sure that was all up-and-running before continuing. To install PEAR, I did the following:
$ cd /usr/local/
$ curl http://pear.php.net/go-pear | sudo php
$ php -q go-pear.php
Go through the PEAR install instructions
$ mate ~/.bash_profile
Added /usr/local/bin to my $PATH variable
Saved and closed TextMate
$ which pear (verified the location of PEAR executable)
$ php -r "phpinfo();" | grep '.ini' (to verify locate of current php.ini)
$ mate /etc/php.ini
Changed 'include_path' setting to: ".:/usr/local/PEAR"
Saved and closed TextMate
$ sudo apachectl restart
Happy with the results, I begin installing a few essential PEAR packages (HTTP, NET, etc..)
I then finish checking out the latest revision of one of our SVN repositories and install the app. I attempt to access it via the browser and get an error to the following effect:
Warning: require_once(HTTP/Request2.php): failed to open stream: No such file or directory in /Users/wilhelm/Sites/wrk/t-box-3a-rxml/public/apps/Mpx/Poller.class.php on line 8
Call Stack:
0.0003 651400 1. {main}() /Users/wilhelm/Sites/wrk/t-box-3a-rxml/public/call.php:0
0.0028 927096 2. RXML_Config::autoload() /Users/wilhelm/Sites/wrk/t-box-3a-rxml/public/config/autoload.php:0
0.0040 1144272 3. require_once('/Users/wilhelm/Sites/wrk/t-box-3a-rxml/public/apps/Mpx/Poller.class.php') /Users/wilhelm/Sites/wrk/t-box-3a-rxml/public/config/autoload.php:18
Fatal error: require_once(): Failed opening required 'HTTP/Request2.php' (include_path='.:/usr/local/PEAR;/Users/wilhelm/Sites/wrk/t-box-3a-rxml/public/Library/Pear/') in /Users/wilhelm/Sites/wrk/t-box-3a-rxml/public/apps/Mpx/Poller.class.php on line 8
Call Stack:
0.0003 651400 1. {main}() /Users/wilhelm/Sites/wrk/t-box-3a-rxml/public/call.php:0
0.0028 927096 2. RXML_Config::autoload() /Users/wilhelm/Sites/wrk/t-box-3a-rxml/public/config/autoload.php:0
0.0040 1144272 3. require_once('/Users/wilhelm/Sites/wrk/t-box-3a-rxml/public/apps/Mpx/Poller.class.php') /Users/wilhelm/Sites/wrk/t-box-3a-rxml/public/config/autoload.php:18
I can verify the location of these files. They DO exist and are in the proper directory. My understanding is that with the 'include_path' of '.:/usr/local/PEAR' PHP first looks in the same directory as the calling script, if nothing is found, it moves to the next path in the list. In the last case, it SHOULD be /usr/local/PEAR, but it comes up with nothing.
The only odd thing I can see from the error report is the following bit in the second section:
(include_path='.:/usr/local/PEAR;/Users/wilhelm/Sites/wrk/t-box-3a-rxml/public/Library/Pear/')
After '.:/usr/local/PEAR' there is a semi-colon and another (valid) path is appended to it. I'm not worried about this particular path, but I'm concerned the semi-colon is causing PHP to think everything after the first colon is a single path. If that's the case, it would make sense that PHP can't find the PEAR libraries.
Given what I've mentioned, could anyone else think of any reason or provide any insight into this matter? Thanks HEAPS!
EDIT:
Alright, this has been resolved. I did executed the following command in the terminal:
$ grep -r -i ini_set("include_path {path/to/project}
Aaaand I found the following:
ini_set("include_path", ini_get("include_path") . ";" . __CONFIG_PATH_LIBRARY_PEAR);
Replacing the ";" with PATH_SEPARATOR fixed the problem nicely.
Thanks go out to Jacob! :)
Search your project for set_include_path or public/Library/Pear/
It appears like you may be adding to the include path somewhere, and used a semi-colon instead of the PHP constant PATH_SEPARATOR, which will give you the correct separator for your OS.