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.
Related
I built PHP in RHEL a while ago using the infamous configure/make/make install procedure, instead of using yum. Now, I planned to include SNMP in my PHP build, but I couldn't find the old configure command. Now I have to reconstruct the configure command just to include the SNMP component. While doing so, I had a thought if there's a way to automatically regenerate the configure command with all the options and parameters. I searched high and low in Google, but I can't find any. So I post here to ask if such method exists. Please share if such step is possible. Thanks.
I am using an open source library ( http://hybridauth.sourceforge.net ) that does not support the PECL OAuth extension of PHP. If you try to run code with it, it says "Exception: Hybridauth Library not compatible with installed PECL OAuth extension. Please disable it."
Easier said than done.
I am hosting my site via Amazon AWS Elastic Beanstalk ( https://aws.amazon.com/elasticbeanstalk/ ). I chose this solution because it allows you to get started quickly with no configuration, no SSH, no custom AMI, ...
Which means I can't easily modify the original php.ini file or delete the extension file.
Is there an easier way? Disabling an extension on the fly? Via a php method? Via an htaccess file? A trick?
No, you cannot disable extensions via PHP method call. In the past you could add it (with dl()), but even then, you was not able to remove any added without playing with ini file.
The short version: No, not in any practical sense.
If you have runkit available you should be able to remove the functions or objects that the module defines, but it really depends on why HybridAuth have trouble working when the PECL OAuth extension is installed. This is not suggested for anything close to a production environment.
You can ssh into your instance very easily if you have your pem key. Just go to the ec2 console, select your instance and click "connect" in the toolbar to get the address. Then you can modify any of the files on the server.
I have an existing linux server, with PHP already installed. I just need to add in the php_ldap module. I do not have root/sudo access (no yum/apt-get), what is the best way to get it installed?
Unfortunately there is none. Even if you get sources and compile it, you will still need to modify apache configuration to get it loaded. I suggest to talk to the admin of the server.
He didn't said that he use apache. Theoretically, if the sources of web-server and php is compiled as the user running the web-server, that should works.
I think it cannot be done without root privilege. If you cannot talk to your client you can look for a php library replacement instead. For example there is a JSON script replaceing the JSON extension.
I compiled php 5.4, and am trying to get an existing site ported to it. The problem I'm seeing is that I didn't use the --with-pdo-pgsql option when running ./configure, so I can't connect to my db.
I've already compiled it twice, is there a way to update the configuration without rerunning make and make install?
No, because the shared module was not built to begin with. I don't think PHP allows partial compile of modules, but check the makefile for ability to build modules one at a time. There are builds for just about everything out there already, so maybe consider a prebuilt (and pre-patched) version as well?
Is there a pure PHP implementation of SQLite that will run on PHP 5.1.6? I am working on an application that would benefit from being able to store data in a relational database, but the server that it has to run on is stuck with PHP 5.1.6 and has been configured "'--without-sqlite"
I have no control over this server; cannot recompile, upgrade or otherwise modify PHP aside from using .htaccess files. Hosting externally is also not an option, unfortunately. MySQL may be possible but would be a nightmare trying to get their IT to create a database for me. (It took them 6 weeks to get .htaccess files enabled because of red tape and other things)
Am I out of luck? My fall back is to write everything to flat files but I really would rather not do that.
EDIT: Fixed typo. PHP does not have the SQLite extension and was configured "'--without-sqlite" according to the output of phpinfo()
Actually, you could easily download and install sqlite in your userspace, whether on windows or on a linux remote shell doesn t usually matter unless your host is unusually restrictive, if that is the case you should change service provider.
Once sqlite is installed, you can one of the available pear extensions or pecl extension to allow easy access through php.
Tutorial and code examples for the pear solution here.