I am trying to use the Oracle connectivity by oci_connect function with JBoss (where Server API is CGI/FastCGI), I am unable to show environment variable over phpinfo() function with JBoss(where Server API is CGI/FastCGI), which is already working fine with PHP and Apache.
Below are the parameters which are showing by jboss/(CGI/FastCGI), system environment variable PATH(which is needed to enable the oci8 module of php) and some other parameters are missing with JBoss.
CGI/FastCGI Environment
Variable Value
PHP_FCGI_CHILDREN 5
PHP_FCGI_MAX_REQUESTS 10000
REDIRECT_STATUS 200
SystemRoot C:\WINDOWS
__COMPAT_LAYER ElevateCreateProcess
Apache Environment
HTTP_COOKIE csrftoken=5LL6M3KDqW6zbW947SUd5qKiDNYvkDiKtNTKO8kbAhiECWitdjdncL2ZRnQQyYVl; PHPSESSID=s2fcp7cbjijjc77i5g195koiil
PATH C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\RSA SecurID Token Common........;
Can anyone provide the help/steps to display the environment variable with JBoss and CGI/FastCGI?
FYI: I am using the window 10 environment.
As I verified the my Project.war file, which has been bundled the php-cgi.exe with php 5.6, here we had the wrong version of java.inc file which Compile The PHP/Java Bridge for PHP library.
I changed my java.inc file then the issue have resolved, and now I can see the oci_connect module inside the phpinfo()
So I realized that, I would have need to use correct java bridge file.
OCI8 Module
Related
I'm trying to get PHP SNMP to work on XAMPP PHP 7.1.9
I'm always getting this result: Warning: SNMP::get(): No response from 127.0.0.1
Here's what I did:
Enabled php_snmp.dll on php.ini
Installed net-snmp-5.5.0-2.x64
Added windows environment variable MIBDIRS with value C:\usr\share\snmp\mibs
Code I'm running to test:
<?php
$session = new SNMP(SNMP::VERSION_1, "127.0.0.1", "public");
$sysdescr = $session->get("sysDescr.0");
echo "$sysdescr\n";
$session->close();
I'm new to this so I'm not sure what I'm missing.
The problem was with the MIBDIRS path.
I followed php docs and it says:
The Windows distribution of Net-SNMP contains support files for SNMP in the mibs directory. This directory should added to Windows' environment variables, as MIBDIRS, with the value being the full path to the mibs directory: e.g. c:\usr\mibs.
Problem was I couldn't find c:\usr\mibs on my net-snmp installation so I used C:\usr\share\snmp\mibs instead.
Solution:
I tried using a device with snmp support instead of 127.0.0.1 and ran snmpget on cli and confirmed net-snmp installation actually works. I figured the problem must be with the path php is using to run snmp.
So I used where snmpget to check the command path then changed MIBDIRS environment value with the result which is C:\usr\bin\snmpget.exe
ubuntu 16.10 / nginx / php7.0 / oracle 11 xe
I'm trying to connect to the Oracle databas via PHP. And I get the following errors.
$conn = oci_connect('login', 'pass', 'localhost/xe');
Warning: oci_connect(): OCIEnvNlsCreate() failed. There is something
wrong with your system - please check that ORACLE_HOME and
LD_LIBRARY_PATH are set and point to the right directories in
/var/www/blah.php on line 26
Warning: oci_connect(): Error while trying to retrieve text for error
ORA-01804 in /var/www/blah.php on line 26
Really request variables, they will be empty. This code return empty string.
$test = getenv('LD_LIBRARY_PATH')." ".getenv('ORACLE_HOME');
print ("$test");
But in phpinfo() they are displayed.
I can write environment variables to each file, but this is not an option.
putenv("ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe");
putenv("LD_LIBRARY_PATH=-Wl,-rpath,/u01/app/oracle/product/11.2.0/xe/lib -L/u01/app/oracle/product/11.2.0/xe/lib -lclntsh");
What can I do?
I solved it by removing semicolon from the line ;clean_env=no in the file /etc/php-fpm.d/www.conf in case of php-fpm 5.6 in CentOS 6. Hope it will help in newer PHP versions. Remember to restart php-fpm service after making changes to this file.
We dont have the same infrastructure but I just solved this same issue in :
Apache
CentOS7
PHP 5
Oracle 12cR1
The message says :
please check that ORACLE_HOME and LD_LIBRARY_PATH are set and point to the right directories
In apache, there is a file where you can set the environment variable :
/etc/sysconfig/httpd. There has to be a config file for nginx.
I added the required environment variables.
Assuming that
ORACLE_HOME is /oracle/product/12.1.0/dbhome_1
Oracle client was installed under /oracle/product/12.1.0/client
Add :
ORACLE_HOME=/oracle/product/12.1.0/dbhome_1
LD_LIBRARY_PATH=/oracle/product/12.1.0/dbhome_1/lib:/oracle/product/12.1.0/dbhome_1/network/lib:/oracle/product/12.1.0/client/lib
I also added :
TNS_ADMIN=/oracle/product/12.1.0/dbhome_1/network/admin
ORACLE_SID=<your sid>
After updating /etc/sysconfig/httpd I just restarted Apache's service httpd and that was it:
$ sudo systemctl restart httpd
I hope it helps !
This is related to the incorrect NLS_LANG parameter. It was set to 'NA' in my case. The fix is:
Windows - The NLS_LANG must be unset in the Windows registry (re-named is best). Look for the NLS_LANG subkey in the registry at \HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE, and rename it.
Linux/UNIX - Here you simply issue the Linux command "unset NLS_LANG"
I am running a PHP 5.4 hosted Web App on Azure. To manage session handling I have configured a Redis cache instance on Azure.
I have set the session save path & handler:
session.save_handler = redis
session.save_path = "tcp://kbcache.redis.cache.windows.net:6379?auth=***"
I have also configured the Redis extensions:
PHP_EXTENSIONS bin\php_igbinary.dll
APPSETTING_PHP_EXTENSIONS bin\php_igbinary.dll
PHP_EXTENSIONS02 bin\php_redis.dll
APPSETTING_PHP_EXTENSIONS02 bin\php_redis.dll
However when I browse to my website I receive the message:
Warning: session_start(): Cannot find save handler 'redis' - session
startup failed in D:\home\site\wwwroot\index.php(22) : eval()'d code
on line 2
What am I missing?
[Update Pre post]
When deployed PHP project, we need enable extensions on Azure.
Please see my website folder structure:
I copied the DLL files into folder named ext. And those dlls' version should be VC9 and non-thread-safe (nts) compatible.
And I created a extension.ini into folder name ini. The content as following :
extension=d:\home\site\ext\php_igbinary.dll
extension=d:\home\site\ext\php_redis.dll
zend_extension=d:\home\site\ext\php_xdebug-2.3.3-5.4-vc9-x86_64.dll
session.save_handler = redis
session.save_path = "tcp://**.redis.cache.windows.net:6379?auth=**
At last, I add the "PHP_INI_SCAN_DIR" Configurtation Panel on Azure portal:
It works for me.
Actually, I tried PHPRedis extension on my environment, it works fine.
Form your description, I think you made configuration of Redis extensions complicated.
I followed those steps:
1.Switch to PHP version 5.4
2.Download PHPRedis extension form this page.
Since I used PHP which version is version 5.4 TS, I downloaded phpredis_5.4_vc9_ts
3.After unzipped the download file, Please copy those DLL file into your PHP ext folder. It seems that you need pay attention to this point.
Add this code into your PHP.ini file
extension=php_igbinary.dll
extension=php_redis.dll
session.save_handler = redis
session.save_path = "tcp://**.redis.cache.windows.net:6379?auth=**
4.Create a Page and test Redis Code:
$redis=new Redis();
$redis->pconnect('tcp://**.redis.cache.windows.net', 6379);
$redis->auth('**+**=');
$redis->set('key', 'hello ');
$redis->append('key', 'world ');
echo $redis->get('key');
had similar issues. make sure redis dll file is there and enabled in php.ini also make sure that redis folder has full write permissions.
I've a development computer, which runs under windows.
For a project, I've to make a php website which has to connect to an Ingres database server.
So I installed wamp, I installed ingres(server and client, on my local machine).
I added the library that I found on their site(php_ingres.dll) in the C:\wamp\bin\php\php5.3.5\ext folder, and I added a line "extension=php_ingres.dll" in the configuration file.
I shutdown wamp and restarted it, and I restarted the server, I see now a check mark in the wamp menu, indicating that php_ingres is now activated. But when I go to the welcome page of the server, I don't see this extension as loaded. If I go on the php info page, I don't see any Ingres entry in the Configure Command.
I just can't found any post/tutorial/... which indicating how to do this operation, so any help would be appreciated!
Thank you!
Edit: I made a small test to see if I can connect to an Ingres database:
<?php
$link = ingres_connect("localhost", "demodbtest", "demodbtest") or die("Connexion impossible");
echo "Connexion réussie";
$result = ingres_query($link,"select * from airline");
while ($row = ingres_fetch_array($result)) {
echo $row["al_iatacode"]; // utilisation du tableau associatif
echo $row["al_name"];
echo $row["al_ccode"]; // utilisation du tableau à indices numériques
echo "</br>";
}
ingres_close($link);
?>
And I get this error:
( ! ) Fatal error: Call to undefined function ingres_connect() in
C:\wamp\www\tests\index.php on line 2
Some information on my installation:
I've a windows 7 pro 32bits
Wampserver 2.1 ( http://sourceforge.net/projects/wampserver/files/WampServer%202/WampServer%202.1/WampServer2.1e-x32.exe/download )
Apache 2.2.17
PHP 5.3.5
Ingres 10.1.0 Community edition( downloaded here: http://esd.ingres.com/product/Community_Projects/Ingres_Database/Windows_32-Bit/Ingres_10.1_Build_121/ingres-10.1.0-121-gpl-win-x86-NoDoc.zip/http )
PHP drivers downloaded here: http://esd.ingres.com/product/drivers/PHP/Windows_32-Bit/PHP_Driver
To practically test if the extension was loaded you can as well call one of it's functions. If the extension was loaded, you should not get a fatal error for a missing function. That's perhaps one of the quickest checks.
Another check is to make use of extension_loaded *PHP Manual** which will give you a list of all loaded extensions. See the PHP Manual link above for more info.
The configure line
The configure line will not show the ingres extension because it has not been compiled in. That's perfectly alright because you load it as an extension (.dll) so it's not part of php.exe. This is why you don't see it in the configure line.
Locating ingres on the phpinfo() page.
On the phpinfo()-page use the search function inside your browser (often CTRL+F) and try to locate the word ingres. You should locate a section that displays the extensions default settings if it has been loaded.
The following is an example screenshot for the xdebug extension. This might look similar for ingres:
Image from: Launching xdebug in Eclipse stuck at 57% - How to trouble-shoot?
Double check your extension_dir setting as well as the actual php.ini file being used. Calling php.exe -i from the command line might not give the same output if executing phpinfo() in a script via Apache (or IIS). In fact http://www.wampserver.com/en/faq.php says there are 3 potential php.ini scripts.
The problem is that I wasn't having the ingres client installed locally, so it appears that this lib cannot works without it
I am getting both modules listed as installed / configured when I use:
php -m
or if I use:
php -i
but when I use:
$m = new Memcache;
// or
$m = new Memcache();
// or
$m = new Memcached();
//or
$m = new Memcached;
I get the following error:
Fatal error: Class 'Memcached' not found
I am running on a Mac - OS X (10.5.7) with default install of apache & php. Additionally, I have memcached running as a daemon on 127.0.0.1:11211 and libmemcache as required by the php-memcached library. I have restarted apache tons of times and even done a machine restart.
Does anyone know why the modules/extensions show up in the command line but not in my phpinfo()? I am literally stumped, after 3 hours of googling, I am just about ready to give up.
Also, please note, my phpinfo() outputs my ini files as follows AND they are both the exact same file:
Configuration File (php.ini) Path: /etc
Loaded Configuration File: /private/etc/php.ini
UPDATE:
Apache is failing to load the extension.
[Fri May 14 04:22:26 2010] [warn]
Init: Session Cache is not configured
[hint: SSLSessionCache] PHP Warning:
PHP Startup: Unable to load dynamic
library
'/usr/lib/php/extensions/no-debug-non-zts-20060613/memcached.so'
- (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load
dynamic library
'/usr/lib/php/extensions/no-debug-non-zts-20060613/memcache.so'
- (null) in Unknown on line 0
Does anyone know why or how this would happen? Both of the files referenced above DEFINITELY ARE there. Should I move this question to server fault?
Your webserver is probably using mod_php, which is a seperate bit of code from the standalone (CLI) interpreter. If they are both using the same ini file, and the memcache extension is configured in the ini file, then it sounds like for some reason, the mod_php is failing to load the extension - check your webserver error_log for startup errors.
It may be that the mod_php was compiled without memcache support (most extensions need to have a stub file linked into the php code, even though the bulk of the code is not linked until run time). Or it may be a permissions problem on the shared object file. Or your webserver may be running chroot, and unable to find the extension (which would also mean that although the ini files appear to have the same path, this is relative to different roots).
HTH
C.
because both versions use different php.ini
place your php.ini into location noted in the phpinfo() outout
I would suspect that the issue revolves around permissions. When you run php from comand line, it runs as the user invoking it. When run as an apache module, it runs as "nobody".
I would assume that the memcached.so file, or the directory it's in does not have proper permissions.
I stumpled upon this post and was having the exact same problem with an extension in my php -i but not in phpinfo(). Mine was a permissions problem because of selinux on a CentOS machine. I had to change ownership and permissions and now it is working as expected.
Set php path in environment variables as given below.
Right-click on "My Computer"
Properties
Advanced Tab > Environment Variables
Under System variables, scroll down to find "Path", select and click on Edit.
Add path to your php install on the end (make sure to precede with semi-colon ";"). Example: ";C:\php7"
Click Ok.