LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices



Reply
 
Search this Thread
Old 10-03-2012, 03:03 PM   #1
Rahb
LQ Newbie
 
Registered: May 2009
Posts: 14

Rep: Reputation: 0
PHP: Oracle *and* SQL


Hi.

I've been handed a Linux (2.6.18) server running Apache(2.2.3)/PHP(5.3.16) that can successfully connect to and retrieve info from an Oracle database. I have confirmed all of this.

I now need to include a local mysql database in the mix. Mysql(5.0.77) is installed and have re-compiled PHP thus;

Code:
/configure --enable-soap --with-mysql=mysqlnd
I can still connect to and retrieve info from the Oracle database but I'm having issues connecting to mysql.

I'm using this in a file named msql.php to test;

Code:
<html>
<head>
<title> PHP Test Script </title>
</head>
<body>
<?php
mysql_connect("localhost", "user", "password") or die(mysql_error());
echo "Connected to MySQL<br />";
?>
</body>
</html>
...I get;

Code:
Fatal error: Call to undefined function mysql_connect() in /var/www/html/msql.php on line 7
I've been through a lot of the standard troubleshooting and have added this to php.ini;

Code:
; Enable mysql extension module
extension=mysql.so
I'm still a little concerned about changes in php.ini not being in the correct location but I'm wondering if I can even do mysql in the same Apache/PHP/Oracle environment.
If so, can someone give me a hand up with the mysql connection?

Thanks, R
 
Old 10-03-2012, 03:43 PM   #2
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Wheezy/Jessie/Sid, Linux Mint DE
Posts: 4,236

Rep: Reputation: 545Reputation: 545Reputation: 545Reputation: 545Reputation: 545Reputation: 545
There is no reason why you cannot make calls to MySQL on an Oracle system. A MySQL call is simply that, regardless of what more is installed.

How did you test your PHP code? From within a web page? Did you restart Apache?
Did you try to run your PHP code in a terminal? php -f msql.php
It should be clear that PHP is not recognizing the mysql function call. This has nothing to do yet with the mysql database.

I am wondering why you compiled PHP. Doesn't your package manager provide PHP? If you just recompiled PHP, did you install it? And even if you installed it, if your distro expects something else than a standard make install it won't run your version of PHP. What distro are you running anyway?

jlinkels
 
1 members found this post helpful.
Old 10-03-2012, 04:52 PM   #3
Rahb
LQ Newbie
 
Registered: May 2009
Posts: 14

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jlinkels View Post
How did you test your PHP code? From within a web page? Did you restart Apache?
Did you try to run your PHP code in a terminal? php -f msql.php
Yes, I restarted Apache and ran something I knew worked before; the initial call to Oracle VIA PHP from a test page. It still works.
Running it from the terminal like you describe, I see a little more info (probably just more of the same);

Code:
Warning: mysql_connect(): [2002] No such file or directory (trying to connect via unix:///tmp/mysql.sock) in /var/www/html/rob_msql.php on line 7
Quote:
Originally Posted by jlinkels View Post
I am wondering why you compiled PHP. Doesn't your package manager provide PHP? If you just recompiled PHP, did you install it? And even if you installed it, if your distro expects something else than a standard make install it won't run your version of PHP. What distro are you running anyway?
The initial install was by compile. Rather than mixing modes I figured I'd stick with it.
Yep; configure, make, make test, make install. It all looked good.

This is on Oracle Linux and yeah, it's a PHP problem. Or more accurately "this guy is very new to PHP problem".
I do still think I have some php.ini location issues;
I see a copy in /etc/init.d
phpinfo( ); says it's in /usr/local/lib but it's not.

Definitely a puzzle.
 
Old 10-03-2012, 05:13 PM   #4
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Wheezy/Jessie/Sid, Linux Mint DE
Posts: 4,236

Rep: Reputation: 545Reputation: 545Reputation: 545Reputation: 545Reputation: 545Reputation: 545
That new error message is telling something really different. Since it is closer to MySQL, without Apache in between I would concentrate on this error first.

What that error message tells is that the mysql_connect function is found in PHP now. But it cannot connect to mysql.

I have checked on my own system running your script, and when I try to connect I get the identical error message when MySQL is not running.

So either you MySQL is not running or you cannot connect because of credentials or a different or conflicting port. Do you know by any change which port is used by Oracle?

Can you try to connect to MySQL using the client: mysql -uusername -ppassword.

jlinkels

Last edited by jlinkels; 10-03-2012 at 05:14 PM.
 
1 members found this post helpful.
Old 10-03-2012, 05:26 PM   #5
Rahb
LQ Newbie
 
Registered: May 2009
Posts: 14

Original Poster
Rep: Reputation: 0
Interesting.

Quote:
Originally Posted by jlinkels View Post
So either you MySQL is not running or you cannot connect because of credentials or a different or conflicting port. Do you know by any change which port is used by Oracle?
Can you try to connect to MySQL using the client: mysql -uusername -ppassword.
No, I don't know the port.

Code:
[root@owbsljtsc01:html]$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 70
Server version: 5.0.77 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>
Does it make a difference that I can't pass the password on the first string? The msql prompt requires that I enter it separately.
 
Old 10-03-2012, 07:11 PM   #6
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Wheezy/Jessie/Sid, Linux Mint DE
Posts: 4,236

Rep: Reputation: 545Reputation: 545Reputation: 545Reputation: 545Reputation: 545Reputation: 545
The problem might be that PHP is trying to connect to mysql here unix:///tmp/mysql.sock. While most likely mysql is listening on another socket by default.

Try to find out where mysql is listening on: netstat -a | egrep 'mysql|3306'. MySQL might be listening on /var/run/mysqld/mysqld.sock and that is a clear mismatch.

Using phpinfo(); gives a lot of information. Look which config files PHP is using, and especially look at the mysql settings, constants and variables.

If you see that PHP tries to read a config file that doesn't exist (either in CLI mode or in web mode) PHP might insert unwanted default values.

Did you insert a space between -p and password? Then it will prompt you.

jlinkels
 
1 members found this post helpful.
Old 10-04-2012, 09:49 AM   #7
Rahb
LQ Newbie
 
Registered: May 2009
Posts: 14

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jlinkels View Post
Try to find out where mysql is listening on: netstat -a | egrep 'mysql|3306'. MySQL might be listening on /var/run/mysqld/mysqld.sock and that is a clear mismatch.
Code:
> netstat -a | egrep 'mysql|3306'
tcp        0      0 *:mysql                     *:*                         LISTEN
unix  2      [ ACC ]     STREAM     LISTENING     14188  /var/lib/mysql/mysql.sock
...and /var/lib/mysql/mysql.sock is empty;

Code:
[root@owbsljtsc01:mysql]$ ll  /var/lib/mysql/mysql.sock
srwxrwxrwx 1 mysql 27 0 Oct  3 11:56 /var/lib/mysql/mysql.sock
Quote:
Originally Posted by jlinkels View Post
Using phpinfo(); gives a lot of information. Look which config files PHP is using, and especially look at the mysql settings, constants and variables.
If you see that PHP tries to read a config file that doesn't exist (either in CLI mode or in web mode) PHP might insert unwanted default values.
In the output of phpinfo();, Configuration File (php.ini) Path is set to /usr/local/lib, which does not exist.

phpinfo(); doesn't seem to be calling out mysql by name, which could be a big clue unless SQLite means the same thing...

EDIT: Actually I DO see mysql on a second look. I'll have to confirm, but should settings like these be managed in /etc/my.cnf?
Code:
<html> 
<head>
<title> PHP Test Script </title>
</head>
<body>
phpinfo()
PHP Version => 5.3.16

System => Linux owbsljtsc01 2.6.18-238.12.1.0.1.el5 #1 SMP Tue May 31 14:51:07 EDT 2011 x86_64
Build Date => Oct  3 2012 11:00:12
Configure Command =>  './configure'  '--enable-soap' '--with-mysql=mysqlnd'
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /usr/local/lib
Loaded Configuration File => (none)
Scan this dir for additional .ini files => (none)
Additional .ini files parsed => (none)
PHP API => 20090626
PHP Extension => 20090626
Zend Extension => 220090626
Zend Extension Build => API220090626,NTS
PHP Extension Build => API20090626,NTS
Debug Build => no
Thread Safety => disabled
Zend Memory Manager => enabled
Zend Multibyte Support => disabled
IPv6 Support => enabled
Registered PHP Streams => php, file, glob, data, http, ftp, phar  
Registered Stream Socket Transports => tcp, udp, unix, udg
Registered Stream Filters => convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk


This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies


 _______________________________________________________________________


Configuration

Core

PHP Version => 5.3.16

Directive => Local Value => Master Value
allow_call_time_pass_reference => On => On
allow_url_fopen => On => On
allow_url_include => Off => Off
always_populate_raw_post_data => Off => Off
arg_separator.input => & => &
arg_separator.output => & => &
asp_tags => Off => Off
auto_append_file => no value => no value
auto_globals_jit => On => On
auto_prepend_file => no value => no value
browscap => no value => no value
default_charset => no value => no value
default_mimetype => text/html => text/html
define_syslog_variables => Off => Off
disable_classes => no value => no value
disable_functions => no value => no value
display_errors => STDOUT => STDOUT
display_startup_errors => Off => Off
doc_root => no value => no value
docref_ext => no value => no value
docref_root => no value => no value
enable_dl => On => On
error_append_string => no value => no value
error_log => no value => no value
error_prepend_string => no value => no value
error_reporting => no value => no value
exit_on_timeout => Off => Off
expose_php => On => On
extension_dir => /usr/local/lib/php/extensions/no-debug-non-zts-20090626 => /usr/local/lib/php/extensions/no-debug-non-zts-20090626
file_uploads => On => On
highlight.bg => <font style="color: #FFFFFF">#FFFFFF</font> => <font style="color: #FFFFFF">#FFFFFF</font>
highlight.comment => <font style="color: #FF8000">#FF8000</font> => <font style="color: #FF8000">#FF8000</font>
highlight.default => <font style="color: #0000BB">#0000BB</font> => <font style="color: #0000BB">#0000BB</font>
highlight.html => <font style="color: #000000">#000000</font> => <font style="color: #000000">#000000</font>
highlight.keyword => <font style="color: #007700">#007700</font> => <font style="color: #007700">#007700</font>
highlight.string => <font style="color: #DD0000">#DD0000</font> => <font style="color: #DD0000">#DD0000</font>
html_errors => Off => Off
ignore_repeated_errors => Off => Off
ignore_repeated_source => Off => Off
ignore_user_abort => Off => Off
implicit_flush => On => On
include_path => .:/usr/local/lib/php => .:/usr/local/lib/php
log_errors => Off => Off
log_errors_max_len => 1024 => 1024
magic_quotes_gpc => On => On
magic_quotes_runtime => Off => Off
magic_quotes_sybase => Off => Off
mail.add_x_header => Off => Off
mail.force_extra_parameters => no value => no value
mail.log => no value => no value
max_execution_time => 0 => 0
max_file_uploads => 20 => 20
max_input_nesting_level => 64 => 64
max_input_time => -1 => -1
max_input_vars => 1000 => 1000
memory_limit => 128M => 128M
open_basedir => no value => no value
output_buffering => 0 => 0
output_handler => no value => no value
post_max_size => 8M => 8M
precision => 14 => 14
realpath_cache_size => 16K => 16K
realpath_cache_ttl => 120 => 120
register_argc_argv => On => On
register_globals => Off => Off
register_long_arrays => On => On
report_memleaks => On => On
report_zend_debug => Off => Off
request_order => no value => no value
safe_mode => Off => Off
safe_mode_exec_dir => /usr/local/php/bin => /usr/local/php/bin
safe_mode_gid => Off => Off
safe_mode_include_dir => no value => no value
sendmail_from => no value => no value
sendmail_path => /usr/sbin/sendmail -t -i  => /usr/sbin/sendmail -t -i 
serialize_precision => 17 => 17
short_open_tag => On => On
SMTP => localhost => localhost
smtp_port => 25 => 25
sql.safe_mode => Off => Off
track_errors => Off => Off
unserialize_callback_func => no value => no value
upload_max_filesize => 2M => 2M
upload_tmp_dir => no value => no value
user_dir => no value => no value
user_ini.cache_ttl => 300 => 300
user_ini.filename => .user.ini => .user.ini
variables_order => EGPCS => EGPCS
xmlrpc_error_number => 0 => 0
xmlrpc_errors => Off => Off
y2k_compliance => On => On
zend.enable_gc => On => On

ctype

ctype functions => enabled

date

date/time support => enabled
"Olson" Timezone Database Version => 2012.3
Timezone Database => internal

Warning: phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Chicago' for 'CDT/-5.0/DST' instead in /var/www/html/rob_php.php on line 7
Default timezone => America/Chicago

Directive => Local Value => Master Value
date.default_latitude => 31.7667 => 31.7667
date.default_longitude => 35.2333 => 35.2333
date.sunrise_zenith => 90.583333 => 90.583333
date.sunset_zenith => 90.583333 => 90.583333
date.timezone => no value => no value

dom

DOM/XML => enabled
DOM/XML API Version => 20031129
libxml Version => 2.6.26
HTML Support => enabled
XPath Support => enabled
XPointer Support => enabled
Schema Support => enabled
RelaxNG Support => enabled

ereg

Regex Library => Bundled library enabled

fileinfo

fileinfo support => enabled
version => 1.0.5-dev

filter

Input Validation and Filtering => enabled
Revision => $Id: 2b8c730d7dfaa8485d07cd792f0c82852ffe4113 $

Directive => Local Value => Master Value
filter.default => unsafe_raw => unsafe_raw
filter.default_flags => no value => no value

hash

hash support => enabled
Hashing Engines => md2 md4 md5 sha1 sha224 sha256 sha384 sha512 ripemd128 ripemd160 ripemd256 ripemd320 whirlpool tiger128,3 tiger160,3 tiger192,3 tiger128,4 tiger160,4 tiger192,4 snefru snefru256 gost adler32 crc32 crc32b salsa10 salsa20 haval128,3 haval160,3 haval192,3 haval224,3 haval256,3 haval128,4 haval160,4 haval192,4 haval224,4 haval256,4 haval128,5 haval160,5 haval192,5 haval224,5 haval256,5 

iconv

iconv support => enabled
iconv implementation => glibc
iconv library version => 2.5

Directive => Local Value => Master Value
iconv.input_encoding => ISO-8859-1 => ISO-8859-1
iconv.internal_encoding => ISO-8859-1 => ISO-8859-1
iconv.output_encoding => ISO-8859-1 => ISO-8859-1

json

json support => enabled
json version => 1.2.1

libxml

libXML support => active
libXML Compiled Version => 2.6.26
libXML Loaded Version => 20626
libXML streams => enabled

mysql

MySQL Support => enabled
Active Persistent Links => 0
Active Links => 0
Client API version => mysqlnd 5.0.8-dev - 20102224 - $Id: 65fe78e70ce53d27a6cd578597722950e490b0d0 $

Directive => Local Value => Master Value
mysql.allow_local_infile => On => On
mysql.allow_persistent => On => On
mysql.connect_timeout => 60 => 60
mysql.default_host => no value => no value
mysql.default_password => no value => no value
mysql.default_port => no value => no value
mysql.default_socket => no value => no value
mysql.default_user => no value => no value
mysql.max_links => Unlimited => Unlimited
mysql.max_persistent => Unlimited => Unlimited
mysql.trace_mode => Off => Off

mysqlnd

mysqlnd => enabled
Version => mysqlnd 5.0.8-dev - 20102224 - $Id: 65fe78e70ce53d27a6cd578597722950e490b0d0 $
Compression => not supported
SSL => supported
Command buffer size => 4096
Read buffer size => 32768
Read timeout => 31536000
Collecting statistics => Yes
Collecting memory statistics => No
Tracing => n/a

Client statistics =>  
bytes_sent => 0
bytes_received => 0
packets_sent => 0
packets_received => 0
protocol_overhead_in => 0
protocol_overhead_out => 0
bytes_received_ok_packet => 0
bytes_received_eof_packet => 0
bytes_received_rset_header_packet => 0
bytes_received_rset_field_meta_packet => 0
bytes_received_rset_row_packet => 0
bytes_received_prepare_response_packet => 0
bytes_received_change_user_packet => 0
packets_sent_command => 0
packets_received_ok => 0
packets_received_eof => 0
packets_received_rset_header => 0
packets_received_rset_field_meta => 0
packets_received_rset_row => 0
packets_received_prepare_response => 0
packets_received_change_user => 0
result_set_queries => 0
non_result_set_queries => 0
no_index_used => 0
bad_index_used => 0
slow_queries => 0
buffered_sets => 0
unbuffered_sets => 0
ps_buffered_sets => 0
ps_unbuffered_sets => 0
flushed_normal_sets => 0
flushed_ps_sets => 0
ps_prepared_never_executed => 0
ps_prepared_once_executed => 0
rows_fetched_from_server_normal => 0
rows_fetched_from_server_ps => 0
rows_buffered_from_client_normal => 0
rows_buffered_from_client_ps => 0
rows_fetched_from_client_normal_buffered => 0
rows_fetched_from_client_normal_unbuffered => 0
rows_fetched_from_client_ps_buffered => 0
rows_fetched_from_client_ps_unbuffered => 0
rows_fetched_from_client_ps_cursor => 0
rows_affected_normal => 0
rows_affected_ps => 0
rows_skipped_normal => 0
rows_skipped_ps => 0
copy_on_write_saved => 0
copy_on_write_performed => 0
command_buffer_too_small => 0
connect_success => 0
connect_failure => 0
connection_reused => 0
reconnect => 0
pconnect_success => 0
active_connections => 0
active_persistent_connections => 0
explicit_close => 0
implicit_close => 0
disconnect_close => 0
in_middle_of_command_close => 0
explicit_free_result => 0
implicit_free_result => 0
explicit_stmt_close => 0
implicit_stmt_close => 0
mem_emalloc_count => 0
mem_emalloc_amount => 0
mem_ecalloc_count => 0
mem_ecalloc_amount => 0
mem_erealloc_count => 0
mem_erealloc_amount => 0
mem_efree_count => 0
mem_efree_amount => 0
mem_malloc_count => 0
mem_malloc_amount => 0
mem_calloc_count => 0
mem_calloc_amount => 0
mem_realloc_count => 0
mem_realloc_amount => 0
mem_free_count => 0
mem_free_amount => 0
mem_estrndup_count => 0
mem_strndup_count => 0
mem_estndup_count => 0
mem_strdup_count => 0
proto_text_fetched_null => 0
proto_text_fetched_bit => 0
proto_text_fetched_tinyint => 0
proto_text_fetched_short => 0
proto_text_fetched_int24 => 0
proto_text_fetched_int => 0
proto_text_fetched_bigint => 0
proto_text_fetched_decimal => 0
proto_text_fetched_float => 0
proto_text_fetched_double => 0
proto_text_fetched_date => 0
proto_text_fetched_year => 0
proto_text_fetched_time => 0
proto_text_fetched_datetime => 0
proto_text_fetched_timestamp => 0
proto_text_fetched_string => 0
proto_text_fetched_blob => 0
proto_text_fetched_enum => 0
proto_text_fetched_set => 0
proto_text_fetched_geometry => 0
proto_text_fetched_other => 0
proto_binary_fetched_null => 0
proto_binary_fetched_bit => 0
proto_binary_fetched_tinyint => 0
proto_binary_fetched_short => 0
proto_binary_fetched_int24 => 0
proto_binary_fetched_int => 0
proto_binary_fetched_bigint => 0
proto_binary_fetched_decimal => 0
proto_binary_fetched_float => 0
proto_binary_fetched_double => 0
proto_binary_fetched_date => 0
proto_binary_fetched_year => 0
proto_binary_fetched_time => 0
proto_binary_fetched_datetime => 0
proto_binary_fetched_timestamp => 0
proto_binary_fetched_string => 0
proto_binary_fetched_blob => 0
proto_binary_fetched_enum => 0
proto_binary_fetched_set => 0
proto_binary_fetched_geometry => 0
proto_binary_fetched_other => 0
init_command_executed_count => 0
init_command_failed_count => 0
com_quit => 0
com_init_db => 0
com_query => 0
com_field_list => 0
com_create_db => 0
com_drop_db => 0
com_refresh => 0
com_shutdown => 0
com_statistics => 0
com_process_info => 0
com_connect => 0
com_process_kill => 0
com_debug => 0
com_ping => 0
com_time => 0
com_delayed_insert => 0
com_change_user => 0
com_binlog_dump => 0
com_table_dump => 0
com_connect_out => 0
com_register_slave => 0
com_stmt_prepare => 0
com_stmt_execute => 0
com_stmt_send_long_data => 0
com_stmt_close => 0
com_stmt_reset => 0
com_stmt_set_option => 0
com_stmt_fetch => 0
com_deamon => 0
bytes_received_real_data_normal => 0
bytes_received_real_data_ps => 0

pcre

PCRE (Perl Compatible Regular Expressions) Support => enabled
PCRE Library Version => 8.12 2011-01-15

Directive => Local Value => Master Value
pcre.backtrack_limit => 1000000 => 1000000
pcre.recursion_limit => 100000 => 100000

PDO

PDO support => enabled
PDO drivers => sqlite, sqlite2

pdo_sqlite

PDO Driver for SQLite 3.x => enabled
SQLite Library => 3.7.7.1

Phar

Phar: PHP Archive support => enabled
Phar EXT version => 2.0.1
Phar API version => 1.1.1
SVN revision => $Id: f7d08da4ab9e515975840c28b830edc9437c3026 $
Phar-based phar archives => enabled
Tar-based phar archives => enabled
ZIP-based phar archives => enabled
gzip compression => disabled (install ext/zlib)
bzip2 compression => disabled (install pecl/bz2)
OpenSSL support => disabled (install ext/openssl)


Phar based on pear/PHP_Archive, original concept by Davey Shafik.
Phar fully realized by Gregory Beaver and Marcus Boerger.
Portions of tar implementation Copyright (c) 2003-2009 Tim Kientzle.
Directive => Local Value => Master Value
phar.cache_list => no value => no value
phar.readonly => On => On
phar.require_hash => On => On

posix

Revision => $Id: c00b7465003bf16b27764ccaea3c159ca2e4419d $

Reflection

Reflection => enabled
Version => $Id: 23c90449811cd1a9c860b115456b64946c2823a9 $

session

Session Support => enabled
Registered save handlers => files user sqlite 
Registered serializer handlers => php php_binary 

Directive => Local Value => Master Value
session.auto_start => Off => Off
session.bug_compat_42 => On => On
session.bug_compat_warn => On => On
session.cache_expire => 180 => 180
session.cache_limiter => nocache => nocache
session.cookie_domain => no value => no value
session.cookie_httponly => Off => Off
session.cookie_lifetime => 0 => 0
session.cookie_path => / => /
session.cookie_secure => Off => Off
session.entropy_file => no value => no value
session.entropy_length => 0 => 0
session.gc_divisor => 100 => 100
session.gc_maxlifetime => 1440 => 1440
session.gc_probability => 1 => 1
session.hash_bits_per_character => 4 => 4
session.hash_function => 0 => 0
session.name => PHPSESSID => PHPSESSID
session.referer_check => no value => no value
session.save_handler => files => files
session.save_path => no value => no value
session.serialize_handler => php => php
session.use_cookies => On => On
session.use_only_cookies => On => On
session.use_trans_sid => 0 => 0

SimpleXML

Simplexml support => enabled
Revision => $Id: a379111021e24ef020a2eefd8ca830cb1ab5b280 $
Schema support => enabled

soap

Soap Client => enabled
Soap Server => enabled

Directive => Local Value => Master Value
soap.wsdl_cache => 1 => 1
soap.wsdl_cache_dir => /tmp => /tmp
soap.wsdl_cache_enabled => 1 => 1
soap.wsdl_cache_limit => 5 => 5
soap.wsdl_cache_ttl => 86400 => 86400

SPL

SPL support => enabled
Interfaces => Countable, OuterIterator, RecursiveIterator, SeekableIterator, SplObserver, SplSubject
Classes => AppendIterator, ArrayIterator, ArrayObject, BadFunctionCallException, BadMethodCallException, CachingIterator, DirectoryIterator, DomainException, EmptyIterator, FilesystemIterator, FilterIterator, GlobIterator, InfiniteIterator, InvalidArgumentException, IteratorIterator, LengthException, LimitIterator, LogicException, MultipleIterator, NoRewindIterator, OutOfBoundsException, OutOfRangeException, OverflowException, ParentIterator, RangeException, RecursiveArrayIterator, RecursiveCachingIterator, RecursiveDirectoryIterator, RecursiveFilterIterator, RecursiveIteratorIterator, RecursiveRegexIterator, RecursiveTreeIterator, RegexIterator, RuntimeException, SplDoublyLinkedList, SplFileInfo, SplFileObject, SplFixedArray, SplHeap, SplMinHeap, SplMaxHeap, SplObjectStorage, SplPriorityQueue, SplQueue, SplStack, SplTempFileObject, UnderflowException, UnexpectedValueException

SQLite

SQLite support => enabled
PECL Module version => 2.0-dev $Id$
SQLite Library => 2.8.17
SQLite Encoding => iso8859

Directive => Local Value => Master Value
sqlite.assoc_case => 0 => 0

sqlite3

SQLite3 support => enabled
SQLite3 module version => 0.7-dev
SQLite Library => 3.7.7.1

Directive => Local Value => Master Value
sqlite3.extension_dir => no value => no value

standard

Dynamic Library Support => enabled
Path to sendmail => /usr/sbin/sendmail -t -i 

Directive => Local Value => Master Value
assert.active => 1 => 1
assert.bail => 0 => 0
assert.callback => no value => no value
assert.quiet_eval => 0 => 0
assert.warning => 1 => 1
auto_detect_line_endings => 0 => 0
default_socket_timeout => 60 => 60
from => no value => no value
safe_mode_allowed_env_vars => PHP_ => PHP_
safe_mode_protected_env_vars => LD_LIBRARY_PATH => LD_LIBRARY_PATH
url_rewriter.tags => a=href,area=href,frame=src,form=,fieldset= => a=href,area=href,frame=src,form=,fieldset=
user_agent => no value => no value

tokenizer

Tokenizer Support => enabled

xml

XML Support => active
XML Namespace Support => active
libxml2 Version => 2.6.26

xmlreader

XMLReader => enabled

xmlwriter

XMLWriter => enabled

Additional Modules

Module Name

Environment

Variable => Value
HOSTNAME => owbsljtsc01
TERM => screen
SHELL => /bin/bash
HISTSIZE => 1000
SSH_CLIENT => 167.237.116.139 51253 22
DISTCC_HOSTS => owbclt01-a owbclt02-a owbcls01-a owbcls02-a owbcls03-a owbsljdmq01 owbsljtmq01 owbsljtmq02
SSH_TTY => /dev/pts/0
DISTCC_POTENTIAL_HOSTS => owbclt01-a owbclt02-a owbcls01-a owbcls02-a owbcls03-a owbsljdmq01 owbsljtmq01 owbsljtmq02
USER => root
LD_LIBRARY_PATH => /usr/lib/oracle/11.2/client64/lib:/usr/lib/oracle/10.2.0.4/client64/lib:/usr/local/lib
LS_COLORS => no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:
MAIL => /var/spool/mail/root
PATH => /u01/bin:/home/remote/pub/bin/linux_x86-64/bin/:/usr/java/jdk1.6.0_11/bin:/home/remote/pub/scripts:/doc/dba/bin:/home/remote/pub/bin/java:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/share/centrifydc/sbin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/share/centrifydc/bin
INPUTRC => /etc/inputrc
PWD => /var/www/html
EDITOR => vi
LANG => en_US.UTF-8
CXX => distcc  g++
HISTCONTROL => ignoreboth
SSH_ASKPASS => /usr/libexec/openssh/gnome-ssh-askpass
SHLVL => 1
HOME => /home/remote/root
LOGNAME => root
CVS_RSH => ssh
SSH_CONNECTION => 167.237.116.139 51253 167.237.144.12 22
PKG_CONFIG_PATH => /usr/local/lib/pkgconfig
LESSOPEN => |/usr/bin/lesspipe.sh %s
CC => distcc gcc
G_BROKEN_FILENAMES => 1
_ => /usr/local/bin/php
OLDPWD => /root

PHP Variables

Variable => Value
_SERVER["HOSTNAME"] => owbsljtsc01
_SERVER["TERM"] => screen
_SERVER["SHELL"] => /bin/bash
_SERVER["HISTSIZE"] => 1000
_SERVER["SSH_CLIENT"] => 167.237.116.139 51253 22
_SERVER["DISTCC_HOSTS"] => owbclt01-a owbclt02-a owbcls01-a owbcls02-a owbcls03-a owbsljdmq01 owbsljtmq01 owbsljtmq02
_SERVER["SSH_TTY"] => /dev/pts/0
_SERVER["DISTCC_POTENTIAL_HOSTS"] => owbclt01-a owbclt02-a owbcls01-a owbcls02-a owbcls03-a owbsljdmq01 owbsljtmq01 owbsljtmq02
_SERVER["USER"] => root
_SERVER["LD_LIBRARY_PATH"] => /usr/lib/oracle/11.2/client64/lib:/usr/lib/oracle/10.2.0.4/client64/lib:/usr/local/lib
_SERVER["LS_COLORS"] => no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:
_SERVER["MAIL"] => /var/spool/mail/root
_SERVER["PATH"] => /u01/bin:/home/remote/pub/bin/linux_x86-64/bin/:/usr/java/jdk1.6.0_11/bin:/home/remote/pub/scripts:/doc/dba/bin:/home/remote/pub/bin/java:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/share/centrifydc/sbin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/share/centrifydc/bin
_SERVER["INPUTRC"] => /etc/inputrc
_SERVER["PWD"] => /var/www/html
_SERVER["EDITOR"] => vi
_SERVER["LANG"] => en_US.UTF-8
_SERVER["CXX"] => distcc  g++
_SERVER["HISTCONTROL"] => ignoreboth
_SERVER["SSH_ASKPASS"] => /usr/libexec/openssh/gnome-ssh-askpass
_SERVER["SHLVL"] => 1
_SERVER["HOME"] => /home/remote/root
_SERVER["LOGNAME"] => root
_SERVER["CVS_RSH"] => ssh
_SERVER["SSH_CONNECTION"] => 167.237.116.139 51253 167.237.144.12 22
_SERVER["PKG_CONFIG_PATH"] => /usr/local/lib/pkgconfig
_SERVER["LESSOPEN"] => |/usr/bin/lesspipe.sh %s
_SERVER["CC"] => distcc gcc
_SERVER["G_BROKEN_FILENAMES"] => 1
_SERVER["_"] => /usr/local/bin/php
_SERVER["OLDPWD"] => /root
_SERVER["PHP_SELF"] => rob_php.php
_SERVER["SCRIPT_NAME"] => rob_php.php
_SERVER["SCRIPT_FILENAME"] => rob_php.php
_SERVER["PATH_TRANSLATED"] => rob_php.php
_SERVER["DOCUMENT_ROOT"] => 
_SERVER["REQUEST_TIME"] => 1349357394
_SERVER["argv"] => Array
(
    [0] => rob_php.php
)

_SERVER["argc"] => 1
_ENV["HOSTNAME"] => owbsljtsc01
_ENV["TERM"] => screen
_ENV["SHELL"] => /bin/bash
_ENV["HISTSIZE"] => 1000
_ENV["SSH_CLIENT"] => 167.237.116.139 51253 22
_ENV["DISTCC_HOSTS"] => owbclt01-a owbclt02-a owbcls01-a owbcls02-a owbcls03-a owbsljdmq01 owbsljtmq01 owbsljtmq02
_ENV["SSH_TTY"] => /dev/pts/0
_ENV["DISTCC_POTENTIAL_HOSTS"] => owbclt01-a owbclt02-a owbcls01-a owbcls02-a owbcls03-a owbsljdmq01 owbsljtmq01 owbsljtmq02
_ENV["USER"] => root
_ENV["LD_LIBRARY_PATH"] => /usr/lib/oracle/11.2/client64/lib:/usr/lib/oracle/10.2.0.4/client64/lib:/usr/local/lib
_ENV["LS_COLORS"] => no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:
_ENV["MAIL"] => /var/spool/mail/root
_ENV["PATH"] => /u01/bin:/home/remote/pub/bin/linux_x86-64/bin/:/usr/java/jdk1.6.0_11/bin:/home/remote/pub/scripts:/doc/dba/bin:/home/remote/pub/bin/java:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/share/centrifydc/sbin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/share/centrifydc/bin
_ENV["INPUTRC"] => /etc/inputrc
_ENV["PWD"] => /var/www/html
_ENV["EDITOR"] => vi
_ENV["LANG"] => en_US.UTF-8
_ENV["CXX"] => distcc  g++
_ENV["HISTCONTROL"] => ignoreboth
_ENV["SSH_ASKPASS"] => /usr/libexec/openssh/gnome-ssh-askpass
_ENV["SHLVL"] => 1
_ENV["HOME"] => /home/remote/root
_ENV["LOGNAME"] => root
_ENV["CVS_RSH"] => ssh
_ENV["SSH_CONNECTION"] => 167.237.116.139 51253 167.237.144.12 22
_ENV["PKG_CONFIG_PATH"] => /usr/local/lib/pkgconfig
_ENV["LESSOPEN"] => |/usr/bin/lesspipe.sh %s
_ENV["CC"] => distcc gcc
_ENV["G_BROKEN_FILENAMES"] => 1
_ENV["_"] => /usr/local/bin/php
_ENV["OLDPWD"] => /root

PHP License
This program is free software; you can redistribute it and/or modify
it under the terms of the PHP License as published by the PHP Group
and included in the distribution in the file:  LICENSE

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

If you did not receive a copy of the PHP license, or have any
questions about PHP licensing, please contact license@php.net.
</body>
</html>

Last edited by Rahb; 10-04-2012 at 09:58 AM.
 
Old 10-04-2012, 10:23 AM   #8
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Wheezy/Jessie/Sid, Linux Mint DE
Posts: 4,236

Rep: Reputation: 545Reputation: 545Reputation: 545Reputation: 545Reputation: 545Reputation: 545
Well, this explains a few things.

First you are not loading a php.ini file. Don't ask me why not. You can specify which .ini file to use on the command line using -c. If you have an .ini file somewhere on your system it might be easier to use it than to create one from scratch. Or search for it on the internet.

The result of not loading the .ini file is that the mysql connector does not know where to connect to mysql. Default apparently is /tmp/mysqld.sock, but your mysql installation has it opened at var/run/mysqld/mysqld.sock. The two will never find each other.

Look at your config:
Code:
var/run/mysqld/mysqld.sock
and mine:
Code:
mysql.default_socket => /var/run/mysqld/mysqld.sock => /var/run/mysqld/mysqld.sock
Strange is that in my php.ini file there is no default socket given. That means the built-in default is used. I assume it is specified during php compile time. Since you can override it, it might be easier to override it in the php.ini instead of recompiling php with this setting correct.

I know I am concentrating on command line behaviour of PHP while you need the Apache interface. I am sure once this is solved on the command line, it is either solved for Apache as well, or it is easy to solve because you know the mechanism. One problem at a time.

jlinkels
 
1 members found this post helpful.
Old 10-04-2012, 01:48 PM   #9
Rahb
LQ Newbie
 
Registered: May 2009
Posts: 14

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jlinkels View Post
If you have an .ini file somewhere on your system it might be easier to use it than to create one from scratch.
I pulled the one from /etc into the location that PHP expects it; /usr/local/lib/


Quote:
Originally Posted by jlinkels View Post
The result of not loading the .ini file is that the mysql connector does not know where to connect to mysql. Default apparently is /tmp/mysqld.sock, but your mysql installation has it opened at var/run/mysqld/mysqld.sock. The two will never find each other.
Look at your config:
Code:
var/run/mysqld/mysqld.sock
and mine:
Code:
mysql.default_socket => /var/run/mysqld/mysqld.sock => /var/run/mysqld/mysqld.sock
I'm not sure what to make of that. The only thing I see is;

Code:
[root@owbsljtsc01:html]$ ls /var/run/mysqld/mysqld.pid
-rw-rw---- 1 mysql 27 5 Oct  4 10:49 /var/run/mysqld/mysqld.pid
That said, I've updated the default socket in php.ini to;

Code:
mysql.default_socket = /var/lib/mysql/mysql.sock
Interestingly enough, now when I submit my script from the command line I get;

Code:
[root@owbsljtsc01:html]$ /usr/local/bin/php -f rob_msql.php
<html>
<head>
<title> PHP Test Script </title>
</head>
<body>
mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD('your_existing_password'). This will store a new, and more secure, hash value in mysql.user. If this user is used in other scripts executed by PHP 5.2 or earlier you might need to remove the old-passwords flag from your my.cnf file
I fixed the offending passwords with some good information at this link;
http://stackoverflow.com/questions/1...authentication

And lo, I was able to connect to the local database. Life is good.

Quote:
Originally Posted by jlinkels View Post
I know I am concentrating on command line behaviour of PHP while you need the Apache interface. I am sure once this is solved on the command line, it is either solved for Apache as well, or it is easy to solve because you know the mechanism. One problem at a time.
The mark of a veteran troubleshooter for sure. Now, looking at the differences between Apache and CLI submission;

Apache;
The Oracle test page works. (Configure Command = './configure' '--with-apxs2' '--with-oci8')
The SQL test page does not.
MySql does not appear in the phpinfo(); test page

CLI;
The Oracle test page does not work. (Configure Command => './configure' '--enable-soap' '--with-mysql=mysqlnd')
The SQL test page works.
MySql appears throughout the phpinfo(); test page.

I have a sinking feeling that I am dealing with two builds of PHP and that my next task is going to be burning one down without burning down the other.
 
Old 10-04-2012, 02:09 PM   #10
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Wheezy/Jessie/Sid, Linux Mint DE
Posts: 4,236

Rep: Reputation: 545Reputation: 545Reputation: 545Reputation: 545Reputation: 545Reputation: 545
Now * I * have the sinking feeling that you need not just to connect to MySQL on a machine which runs Oracle. but you need to connect to both Oracle and MySQL from within PHP. That was not clear to me before.

And yes, as it seems Apache uses the PHP-with-Oracle-included and CLI uses PHP-with-MySQL-included.

Of course MySQL call in PHP is just the inclusion of additional libraries. I don't see why they have to be mutually exclusive. Have you tried to compile your PHP version with both Oracle and MySQL support? If you do that for your last version (the one which includes MySQL) you can see if compiling is succesful, and test it CLI. If that functions, it should be easy (ha!) to tell Apache to use your compiled version.

jlinkels
 
1 members found this post helpful.
Old 10-04-2012, 02:45 PM   #11
Rahb
LQ Newbie
 
Registered: May 2009
Posts: 14

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jlinkels View Post
Now * I * have the sinking feeling that you need not just to connect to MySQL on a machine which runs Oracle. but you need to connect to both Oracle and MySQL from within PHP. That was not clear to me before.
No, simultaneous functionality is not the goal. It's just gravy, but I like gravy and figured I'd reach for it if it was handy.

Quote:
Originally Posted by jlinkels View Post
Of course MySQL call in PHP is just the inclusion of additional libraries. I don't see why they have to be mutually exclusive. Have you tried to compile your PHP version with both Oracle and MySQL support? If you do that for your last version (the one which includes MySQL) you can see if compiling is succesful, and test it CLI. If that functions, it should be easy (ha!) to tell Apache to use your compiled version.
Yeah, I think I'll take a shot at that. From what I can see it seems like it should be as "simple" as making the correct libphp5.so available in the right place (in my case /usr/lib64/httpd/modules).
 
Old 10-04-2012, 05:33 PM   #12
Rahb
LQ Newbie
 
Registered: May 2009
Posts: 14

Original Poster
Rep: Reputation: 0
Curious.

I've recompiled with;

Code:
./configure --enable-soap --with-mysql=mysqlnd  --with-oci8 --with-zlib-dir=/usr/include/
make
make test
make install
The datestamp on libphp5.so shows it's been updated and httpd.conf is pointing at it correctly.

In the web based PHP info page it still only shows;
Code:
Configure Command	 './configure' '--with-apxs2' '--with-oci8'
There's something basic I must be missing here or maybe I've just been looking at this too long this today.
 
Old 10-04-2012, 08:10 PM   #13
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Wheezy/Jessie/Sid, Linux Mint DE
Posts: 4,236

Rep: Reputation: 545Reputation: 545Reputation: 545Reputation: 545Reputation: 545Reputation: 545
I think it was too long.

You already drew the conclusion that Apache uses a different PHP version from your compiled version. That is not different now you compiled again.

Using the command line you should see both MySQL and Oracle working. (Crossing fingers....)

Now somewhere in the Apache config you should see that Apache points to a different PHP executable.

jlinkels
 
Old 10-05-2012, 10:47 AM   #14
Rahb
LQ Newbie
 
Registered: May 2009
Posts: 14

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jlinkels View Post
Using the command line you should see both MySQL and Oracle working. (Crossing fingers....)
This is the case.

Quote:
Originally Posted by jlinkels View Post
Now somewhere in the Apache config you should see that Apache points to a different PHP executable.
Hrm. Maybe this is sinking in.
The PHP executable I use at the command line is in /usr/local/bin;

_SERVER and _ENV look good here;
Code:
[root@owbsljtsc01:html]$ /usr/local/bin/php -f rob_php.php |grep /usr/local/bin/
_ => /usr/local/bin/php
_SERVER["_"] => /usr/local/bin/php
_ENV["_"] => /usr/local/bin/php
VIA Apache, they're set incorrectly.
Code:
_SERVER["PATH"]	/sbin:/usr/sbin:/bin:/usr/bin
_ENV["PATH"]	/sbin:/usr/sbin:/bin:/usr/bin
To me this almost seems to be the endgame if I can understand how to fix that but that's a leap.
I'm curious, where does Apache learn about these variables? I don't see any reference to them in httpd.conf or php.ini.
 
Old 10-05-2012, 12:01 PM   #15
Rahb
LQ Newbie
 
Registered: May 2009
Posts: 14

Original Poster
Rep: Reputation: 0
Okay, it's a heinous hack but I've temporarily symlinked the executable;

Code:
[root@owbsljtsc01:/]$ ln -s /usr/local/bin/php /usr/sbin/php
[root@owbsljtsc01:/]$ service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]
...and everything works from both side (MySQL/Oracle, CLI/Apache).

FWIW, I'd still like to know where Apache pulls that info (and do the right thing).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Oracle/SQL book icecubeflower Linux - Newbie 5 08-03-2009 10:59 PM
Oracle Monitoring via SQL viky Linux - Software 0 10-02-2007 06:32 AM
Oracle SQL+ darkRoom Programming 2 05-20-2004 10:01 PM
Oracle SQL IDE grayswander Linux - Software 4 12-05-2003 12:17 PM
SQL and Oracle Rutnut Linux - General 3 04-07-2002 01:39 AM


All times are GMT -5. The time now is 11:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration