Trouble using posix_kill in php - php

I'm using php 5.5.11 and when I try to call posix_kill I get the following error:
Fatal error: Call to undefined function posix_kill() in /var/www/.../someScript.php on line 861
I'm not sure what more information is relevant, feel free to ask.

You need to install PHP's posix extension which implements that function. Without that extension the function simply is not defined, which leads to the error.
How to install such an extension package depends on your operating system. Easiest is in Linux where you can search, identify, download and install packages with a single click inside the software management system.

Related

Why is twig_template_get_attributes() throwing a fatal error?

I have twig installed via composer on a new codebase I'm working on (OSX), and on a new server I was trying install my app on. I started getting a fatal error on twig_template_get_attributes()
namely
PHP Fatal error: Call to undefined function twig_template_get_attributes() in /<path_to_here>/templates_c/a2/4e/3fbd69b54a0875d7cd3744d62bf1fa98ed4e7b1b375f904ead10b7cb27b6.php
I don't have this problem locally (OSX), and I was trying figure out why this is happening on my other server (Ubuntu 12.04 if that matters). When I install twig as a PHP extension the problem goes away, but my understanding is that the extension is completely optional and only optimizes one call
as per the documentation
The C extension is optional but it brings some nice performance
improvements. Note that the extension is not a replacement for the PHP
code; it only implements a small part of the PHP code to improve the
performance at runtime; you must still install the regular PHP code.
and
And from now on, Twig will automatically compile your templates to
take advantage of the C extension. Note that this extension does not
replace the PHP code but only provides an optimized version of the
Twig_Template::getAttribute() method.
very confused about this behavior.

Where to find extension-printer.dll

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.

PHP Fatal error during a DreamFactory installation

I am pulling hairs here and choking kittens with frustration..
Trying to find a nice and easy framework to pull data from a MySQL server to my iOS and Android apps using REST-API and I found this little promising application called DreamFactory.
I had myriad of issues until I finally stumbled on this one while installing:
PHP Fatal error: Call to undefined function mcrypt_encrypt() in /opt/dreamfactory/platform/var/www/launchpad/vendor/kisma/kisma/src/Kisma/Core/Utility/Hasher.php on line 501
Has anyone encountered this during installation of DreamFactory and can advise me or alternatively another similar application?
you can run php -m to list which php modules you have installed. Here is the link to learn about mcrypt.
http://php.net/manual/en/book.mcrypt.php
installing with PECL
https://pecl.php.net/package/mcrypt
installing with homebrew:
https://gist.github.com/teroyks/e0d271e6720eda692456
Have you tried using the Bitnami prepackaged version including stack? It's literally turnkey:
https://bitnami.com/stack/dreamfactory

Undefined hw_who()?

Hi i found this function hw_who() which says to Gets the list of currently logged in users.
however when i want to use it like that:
print_r(hw_who());
i get this error message
Fatal error: Call to undefined function hw_who() in ...
I have looked every where but it seems no post or how to use it.
anyhelp thanks !
EDIT:
my php version is : PHP Version 5.4.26
From the PHP manual:
This extension is considered unmaintained and dead. However, the
source code for this extension is still available within PECL SVN
here: » http://svn.php.net/viewvc/pecl/hyperwave.
This extension has been moved to the » PECL repository and is no
longer bundled with PHP as of PHP 5.0.0
So either you've installed it incorrectly via PECL, or you just haven't considered that.
My advice: Tackle your issue at hand differently.

Enabling php sysvshm extension without recompiling

I am using a shared host. PHP is compiled with --disable-sysvshm. I get the following error while running a script:
Fatal error: Call to undefined function shm_attach() in ...
Is there any way to enable it without re-compiling php?
There is, but as a regular user, you can't do it. You'll need admin access.
If you have root access, then your package manager should have the extension available if it doesn't come built into PHP. For SuSE, it's looking like a php-sysvshm package would do it. If there's no package, you'll still need to rebuild, but it's doable.
If you don't have the access you'd need to build PHP or install packages, you won't be able to build or install, let alone load, extensions (which are pretty much the only way you can add functionality without replacing your existing PHP). In that case, you'll need to talk to your web host and see if they will install it for you. If they won't, then that's pretty much it.

Categories