Getting Fatal error: Call to undefined function mysql_connect() error.
ok, so before I had my mysql_connect php script and it ran fine, no errors, but once I changed my php.ini file to give ERROR_REPORTING E_ALL I now get Fatal error: Call to undefined function mysql_connect(). I am just wondering how I can fix this?
I followed the arch linux LAMP wiki and I can't figure out why I am getting this error after turnning on error_reporting.
Thanks
this is my php code
<?php
$connection = mysql_connect('localhost', 'root', 'password');
if(!$connection){
echo mysql_error();
} else {
echo 'connected';
if (!mysql_select_db('my_first_db')){
echo 'uh';
} else {
echo 'selected database';
?>
<?php phpinfo(); ?>
Last edited by clandest (2012-03-22 04:36:43)
aking9 wrote:grabbing into the back of the back of my memory here but don't you need to specify a port to connect to?
Only if you change the port from the default 3306. But even then, a different error message will output, in this case the mysql modules have not loaded for some reason.
There is a syntax error in your php.ini file, at line 510. Comment out this line as it's a line giving information rather than an option. Then uncomment the error_reporting option.
So this:
Default Value: E_ALL & ~E_NOTICE
; Development Value: E_ALL | E_STRICT
; Production Value: E_ALL & ~E_DEPRECATED
; http://php.net/error-reporting
;error_reporting = E_ALL & ~E_DEPRECATED
Should be changed to this:
; Default Value: E_ALL & ~E_NOTICE
; Development Value: E_ALL | E_STRICT
; Production Value: E_ALL & ~E_DEPRECATED
; http://php.net/error-reporting
error_reporting = E_ALL & ~E_DEPRECATED
After this try "sudo /etc/rc.d/httpd restart" then see if you have any better luck connecting to mysql.
Last edited by astiak (2012-03-22 23:24:40)
Similar Messages
-
[SOLVED]Call to undefined function mysql_connect()
Hi. Up until this point I have had mysql, php, and apache up and running just fine. Recently I made a little change. I configured Apache to read my .php pages from /home/user/code/php instead of /srv/http. It wasn't working originally so I created a new http user using this command:
useradd -d /srv/http -r -s /bin/false -U http
And replaced /srv/http with the directory of my choice. Almost everything went fine. I was able to see all my .php files. The problem was with one file. This is the code for it:
<?php
mysql_connect("localhost", "root", "mypass") or die(mysql_error());
echo "Connected to MySQL<br />";
?>
Originally it displayed everything fine but once I made the switch it displayed this error:
Fatal error: Call to undefined function mysql_connect() in /home/'user'/code/php/connect.php on line 2
I tried to login to phpMyAdmin as well and this error is displayed:
The mysqli extension is missing. Please check your PHP configuration. <a href="Documentation.html#faqmysql" target="documentation"><img src="themes/dot.gif" title="Documentation" alt="Documentation" class="icon ic_b_help" /></a>
Not sure if it matters but I have made the switch to a systemd only installation and have run systemctl enable httpd.service, systemctl enable mysqld.service, systemctl start httpd.service, and systemctl start mysql.service countless times just to be sure. I have also made sure that
extension=mysqli.so
extension=mysql.so
Are both uncommented in /etc/php/php.ini
Last edited by xworld (2012-11-08 00:48:14)Here's phpinfo():
Linux net 3.6.6-1-ARCH #1 SMP PREEMPT Mon Nov 5 11:57:22 CET 2012 x86_64
Build Date Oct 17 2012 20:31:37
Configure Command './configure' '--srcdir=../php-5.4.8' '--config-cache' '--prefix=/usr' '--sysconfdir=/etc/php' '--localstatedir=/var' '--with-layout=GNU' '--with-config-file-path=/etc/php' '--with-config-file-scan-dir=/etc/php/conf.d' '--disable-rpath' '--mandir=/usr/share/man' '--without-pear' '--disable-cli' '--with-apxs2' '--enable-bcmath=shared' '--enable-calendar=shared' '--enable-dba=shared' '--enable-exif=shared' '--enable-ftp=shared' '--enable-gd-native-ttf' '--enable-intl=shared' '--enable-mbstring' '--enable-phar=shared' '--enable-posix=shared' '--enable-shmop=shared' '--enable-soap=shared' '--enable-sockets=shared' '--enable-sysvmsg=shared' '--enable-sysvsem=shared' '--enable-sysvshm=shared' '--enable-zip=shared' '--with-bz2=shared' '--with-curl=shared' '--with-db4=/usr' '--with-enchant=shared,/usr' '--with-freetype-dir=/usr' '--with-gd=shared' '--with-gdbm' '--with-gettext=shared' '--with-gmp=shared' '--with-iconv=shared' '--with-icu-dir=/usr' '--with-imap-ssl' '--with-imap=shared' '--with-jpeg-dir=/usr' '--with-vpx-dir=/usr' '--with-ldap=shared' '--with-ldap-sasl' '--with-mcrypt=shared' '--with-mhash' '--with-mssql=shared' '--with-mysql-sock=/var/run/mysqld/mysqld.sock' '--with-mysql=shared,mysqlnd' '--with-mysqli=shared,mysqlnd' '--with-openssl=shared' '--with-pcre-regex=/usr' '--with-pdo-mysql=shared,mysqlnd' '--with-pdo-odbc=shared,unixODBC,/usr' '--with-pdo-pgsql=shared' '--with-pdo-sqlite=shared,/usr' '--with-pgsql=shared' '--with-png-dir=/usr' '--with-pspell=shared' '--with-snmp=shared' '--with-sqlite3=shared,/usr' '--with-tidy=shared' '--with-unixODBC=shared,/usr' '--with-xmlrpc=shared' '--with-xsl=shared' '--with-zlib'
Server API Apache 2.0 Handler
Virtual Directory Support disabled
Configuration File (php.ini) Path /etc/php
Loaded Configuration File /etc/php/php.ini
Scan this dir for additional .ini files /etc/php/conf.d
Additional .ini files parsed (none)
PHP API 20100412
PHP Extension 20100525
Zend Extension 220100525
Zend Extension Build API220100525,NTS
PHP Extension Build API20100525,NTS
Debug Build no
Thread Safety disabled
Zend Signal Handling disabled
Zend Memory Manager enabled
Zend Multibyte Support provided by mbstring
IPv6 Support enabled
DTrace Support disabled
Registered PHP Streams compress.zlib, php, file, glob, data, http, ftp
Registered Stream Socket Transports tcp, udp, unix, udg
Registered Stream Filters zlib.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk
Sorry if there is a better way to post this. If so I'm willing to fix it. I posted the part that I thought was relevant
I do have extension_dir="/usr/lib/php/modules:
; Directory in which the loadable extensions (modules) reside.
; http://php.net/extension-dir
extension_dir = "/usr/lib/php/modules/"
; On windows:
; extension_dir = "ext"
Also, the file /usr/lib/php/modules/mysql.so does exist. -
Fatal error: Call to undefined function oci_connect()
I get below error when I try to connect to oracle in PHP on SUSE 10. I orginally posted this question in PHP forum but I was advised to post it to Linux forum. so here is the error and other details.
Fatal error: Call to undefined function oci_connect()
I followed one of the documentation realed to this error and I get below error.
/home/knaik # php -version
PHP 5.2.5 with Suhosin-Patch 0.9.6.2 (cli) (built: Apr 23 2008 23:35:28)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
/home/knaik/oci8-1.3.5 # phpize
Configuring for:
PHP Api Version: 20041225
Zend Module Api No: 20060613
Zend Extension Api No: 220060519
Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF
environment variable is set correctly and then rerun this script.
I was looking into below link. But I could not find oci8.so file after the OCI build.
http://www.orware.net/tips-and-how-tos/plesk/46-oracle-oci8-php-installation.html
===================================================
===> In reply to my request *"mgogala's"* reply was as below.
Install autoconf using yast. Check whether the package is installed by using:
$>rpm -qa autoconf
autoconf-2.59-5
BTW, this is not a Linux forum. There is one on OTN, I'm sure that Frits Hoogland will gladly help you out.
====>
I am not able to find "autoconf" rpm for Suse 10.
Below is the exact version details of the O/S.
#*more SuSE-release*
SUSE Linux Enterprise Server 10 (i586)
VERSION = 10
PATCHLEVEL = 2
#*uname -a*
Linux osdvglobalopsdv02 2.6.16.60-0.21-smp #1 SMP Tue May 6 12:41:02 UTC 2008 i686 i686 i386 GNU/Linux
Please let me know, from where can I download this RPM?
Thanks
Shellybtw, this is the oracle enterprise linux forum, the forum specific for oracle's linux distro, there is a general linux forum here: Generic Linux
-
Hi all,
when I use this php script
<?php
$db_conn = ocilogon("venus_pkg","venus_pkg","ventst");
?>
I get this error:
Fatal error: Call to undefined function ocilogon() in d:\SITO\VENTST.php on line 3
How to configure Apache 1.3.3 with PHP version 5 to use OCI?
Thanks in advanceHi,
Even I am facing the same problem. I have done all the above mentioned settings. I have set the php.ini file with the extension dirt to "php/ext" and also uncommented the extension=phpoci8.dll . we r using PHP5.2.0, Apache 2.2 and Oracle 10g and installed both the XE and the Client edition of oRACLE 10G on windows XP.
Trying to execute the code:
<?php
echo "<h1>OCI Test</h1>\n";
$conn=OCILogon("username", "password", "system");
$stmt = OCIParse($conn, "SELECT * FROM employee ORDER BY name");
OCIExecute($stmt, OCI_DEFAULT);
while (OCIFetch($stmt)) {
$table_name = OCIResult($stmt, "employee");
echo "$table_name<br />\n";
OCIFreeStatement($stmt);
OCILogoff($conn);
?>
and getting the error as:
Debug Error: C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\test.php line 3 - Call to undefined function OCILogon()
Please help me out solving this problem. -
http://www.oracle.com/technology/tech/php/htdocs/inst_php_apache_windows.html
I have followed all these instructions, installed what was specified (including all versions needed).
First problem I encountered was there were no oci8 title in phpinfo.php,
Second was when I compiled the oci8test.php it brings this error,
Fatal error: Call to undefined function ocilogon() in C:\Program Files\Apache Group\Apache2\htdocs\ocisample.php on line 3
As I said, I have followed exactly what was specified in the instructions, yet the error is persistent.
Actions taken:
restarted apache
checked folder locations
checked php.ini-recommended
checked httpd.conf
everything is where they need to be.
I need help.
Thanks everyone. Have a nice day.If this is line #3, then try changing "//127.0.0.1/XE" to "localhost", or better yet to your TNS alias, which is typically "XE".
$db_conn = ocilogon("hr", "your_hr_password", "//127.0.0.1/XE");
It should look like this if you're using a USER account of test with a password of test:
$db_conn = ocilogon("test","test","XE"); -
Fatal error: Call to undefined function OCILogon()
Dear,
Under WinXp_Sp2 in iis I installed 5.1.6. It worked fine but when used with oracle 9.2.0.1.0 it gives error "Fatal error: Call to undefined function OCILogon()" while other extensions are working fine in extension dir. Please help me.
Thanks & regards.
JamilYou haven't mentioned having 9i installed locally. This way it should work well but in some cases ORACLE_HOME dependencies could not be resolved. If you need precise information what file to put where try the filemon utility.
http://www.sysinternals.com/Utilities/Filemon.html
It would show you the files php is trying to access in order to make use of the oci module. -
Fatal error: Call to undefined function add__custom_background() in /home4/dargonza/public_html/wp-content/themes/twentythirteen/functions.php on line 24
While practicing with HTML with WordPress Themes, I inserted a phrase (add_custom_background) in the wrong sentence.Its wordpress theme issue
*issue in path location
Try with wordpress forum
*http://wordpress.org/support/
May be try this
*http://wordpress.org/support/topic/fatal-error-call-to-undefined-function-add_custom_background -
1) Configured Php4.4 to have oci8 enabled with Apache2.2 on Windows 2000 ( service pack4). No error at the time of Apache start but when trying to connect to Oracle using Oracle Instant Client below error is thrown..
"Fatal error: Call to undefined function: ocilogon() in C:\Apache2 \htdocs\star\dbconnect.php on line 7"
Configuration steps..
1) Uncommented "extension=php_oci8.dll" in php.ini to enable oci API's.
2)Configured Oracle Instant client by adding path to Windows path variable as per it documentation.
3)Copied all Php4.4 dlls( oci..etc) into the directory pointed by "PHPIniDir", which is configured in httpd.conf
If i run phpinfo(), i dont see oci8 enabled in the output. I guess there is problem in the configuration? Any insights into the error is greatly appreciated..
BTW, I did same configuartion on Windows XP and is working fine..Also, I dont see path value for path variable in phpinfo() ouput for Oracle Instant Client, which i updated in Windows?
Below is the snippet of ouput from phpinfo().
Apache Environment
Variable Value
HTTP_ACCEPT image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, */*
HTTP_ACCEPT_LANGUAGE en-us
HTTP_ACCEPT_ENCODING gzip, deflate
HTTP_USER_AGENT Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
HTTP_HOST localhost
HTTP_CONNECTION Keep-Alive
PATH D:\CESi\isis\bin;D:\CESi\Gateway\mico-win32-bin\;D:\CESi\Gateway\;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\Program Files\Support Tools\
SystemRoot C:\WINNT
COMSPEC C:\WINNT\system32\cmd.exe
PATHEXT .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
WINDIR C:\WINNT
SERVER_SIGNATURE <address>Apache/2.0.59 (Win32) PHP/4.4.4 Server at localhost Port 80</address>
SERVER_SOFTWARE Apache/2.0.59 (Win32) PHP/4.4.4
SERVER_NAME localhost
SERVER_ADDR 127.0.0.1
SERVER_PORT 80
REMOTE_ADDR 127.0.0.1
DOCUMENT_ROOT C:/Apache2/htdocs
SERVER_ADMIN [email protected]
SCRIPT_FILENAME C:/Apache2/htdocs/info.php
REMOTE_PORT 4977
GATEWAY_INTERFACE CGI/1.1
SERVER_PROTOCOL HTTP/1.1
REQUEST_METHOD GET
QUERY_STRING no value
REQUEST_URI /info.php
SCRIPT_NAME /info.php
Environment
Variable Value
ALLUSERSPROFILE C:\Documents and Settings\All Users
CMM_CELL CSTAR_STAR
CommonProgramFiles C:\Program Files\Common Files
COMPUTERNAME STAR-SM-NR-PROD
ComSpec C:\WINNT\system32\cmd.exe
NUMBER_OF_PROCESSORS 2
OS Windows_NT
Os2LibPath C:\WINNT\system32\os2\dll;
Path D:\CESi\isis\bin;D:\CESi\Gateway\mico-win32-bin\;D:\CESi\Gateway\;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\Program Files\Support Tools\
PATHEXT .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
PROCESSOR_ARCHITECTURE x86
PROCESSOR_IDENTIFIER x86 Family 6 Model 11 Stepping 1, GenuineIntel
PROCESSOR_LEVEL 6
PROCESSOR_REVISION 0b01
ProgramFiles C:\Program Files
SMS_LOCAL_DIR C:\WINNT
SystemDrive C:
SystemRoot C:\WINNT
TEMP C:\WINNT\TEMP
TMP C:\WINNT\TEMP
USERPROFILE C:\Documents and Settings\xwback
windir C:\WINNT
AP_PARENT_PID 884 -
PHP- Oracle not working- Call to undefined function OCILogon() ERROR
Hi,
I am trying to just do a test program to test php - oracle connection,
My versions are: php5.2.1-Win32 and Oracle 10g
I have made the following settings:
1.) Uncommented the following lines in php.ini:
extension=php_oci8.dll
extension=php_oracle.dll
2.) Set extension_dir = "C:\php-5.2.1-Win32\ext"
Changed the httpd.conf file as: ADDED
1.)LoadModule php5_module C:/php-5.2.1-Win32/php5apache2.dll
2.)PHPIniDir "C:/Program Files/Apache Group/Apache2/conf-"
3.) LoadFile "C:/php/php5ts.dll"
4.)<IfModule php5_module>
<Location />
AddType text/html .php .phps
AddHandler application/x-httpd-php .php
AddHandler application/x-httpd-php-source .phps
</Location>
</IfModule>
5.) AddType application/x-httpd-php .php
AddType application/x-httpd-php .phtml
AddType application/x-httpd-php-source .phps
But when I am tryin to run the following program:
<?php
echo "<h1>OCI Test</h1>\n";
$conn=OCILogon("system", "sheetal16", "orcl");
$stmt = OCIParse($conn, "SELECT table_name FROM user_tables ORDER BY table_name");
OCIExecute($stmt, OCI_DEFAULT);
while (OCIFetch($stmt)) {
$table_name = OCIResult($stmt, "TABLE_NAME");
echo "$table_name<br />\n";
OCIFreeStatement($stmt);
OCILogoff($conn);
?>
I am getting the following error:
OCI Test
Fatal error: Call to undefined function OCILogon() in C:\Program Files\Apache Group\Apache2\htdocs\test2.php on line 3
Please help me to solve this problem.
Thanks,
SheetalSee Re: PHP- Oracle not working- Call to undefined function OCILogon() ERROR
-
the website I am trying to go in is www.marinacraft.com.my
Staff working there told me there is no problem with their website.Sorry, but it doesn't help JTANNA.
What is your definition of "more efficiently"? If it's limitation of search results, branded search, and limitation of styling your results then google search is more efficient. Real developers rely on their own developments. For example: how can google search display results from a password-protected site? They can't.
best,
Shocker -
Does anyone have any ideas?
or could they please give me a better logon script tutorial?Dreamweaver is using the "virtual" syntax because in your Site Definition, the "Create Links Relative To:" option is set to Site. If you change that to "Document" instead, Dreamweaver will use the "require_once"syntax.
-
Fatal error: Call to undefined function virtual() /login.php on line 1
How could this be? I created it using the Login form wizard.
Replace virtual with
require_once
The problem is most likely that you have defined a wrong path to your connection script
You must insert or delete
before Connections - until the remote server finds the connectionscript
regards -
I was able to use Firefox before I tried to update it pursuant to prompt that I did not have the latest version. Now I cannot use it any more. How can I remove this latest version so I can use Firefox again. I use Windows Vista. Thanks,
Evewonder wrote:
vic wrote:
wonder wrote:what's your user id?
when asked for uuid/uid?... I put 100. I thought any random number would do...
look in /etc/pam.d/gdm-password
in arch and in general >= 1000 are normal users, < 1000 system users
is that how it works? can i change it from 100 to 1000 or just make a new one?
anyways i'll look to it. -
Oci not loaded (Call to undefined function oci_connect)
hi
i have oracle linux with oracle database 11gR2
i install php with oci as the following link :
http://oss.oracle.com/projects/php/dist/documentation/installation.html
but when i try phpinfo() i found just only
*" /etc/php.d/oci8.ini"* in the result
and when i test connection i have this error
*" Fatal error: Call to undefined function oci_connect() "*Cross-posted
Re: problem with httpd and oracle database -
Hi
I've just installed Xampp 1.7.2 locally with PHP Version 5.3.0 and Apache 2.2.12 on a Windows platform
and I now I'm really in a big trouble !!!
My home pages wich have a Login forms do not work anymore !!! They give me back this error:
Fatal error: Call to undefined method tNG_fields::tNG_fields() in C:\xampp\htdocs\MySite\includes\tng\tNG_custom.class.php on line 30
I think it's probably the new PHP version 5.3.0 and I'm really worried because I have many sites around made with ADD and if the servers will be as probably be updated to the new PHP version all my sites will stop working !!!
What can I do? I'm really desperated and fell abandoned....PLEASE HELP !!!
MonikkaYes, it almost surely is version 5.3.0 of PHP. Any version below will work with ADDT,with 5.3.0, ADDT breaks.
The only real solution is to not use 5.3.0 and use a less recent version. With Xamp, the package is bundled, PHP and MySQL. I had this exact same issue and someone, I think Gunter, suggested moving to WAMP which allows you to run different versions of PHP and MySQL as you desire. This worked.
The most disturbing thing for me was the "writing on the wall"...the ADDT life clock is ticking. Remaining on CS4 and PHP 5.2 extends the useful life - but at some point, we will be forced by something to upgrade (like our ISP), then big problems.
Jim
Maybe you are looking for
-
I have two different 5s's with two different phone numbers but they are both using the same iCloud/apple account. After upgrading to iOS8 when I get a phone call on one phone both phones ring. One phone is for work and one is for private and I don't
-
Withholding tax calculation with formula base problem
Dear all, I maintained some formula depend on client requirement. for example: up to 200,000.00 no withholding tax 2 lax to500,000.00 <1.00 %> tax
-
Insert or Cut Time and move automation data - how to do it?
Hi when I cut or insert time it moves the regions but not the automation data. I have tried switching nn 'move automation with regions' but it doesn't move the automation that goes past the end f regions eg plug in settings like delay feedbacks etc.
-
Today when I opened Firefox the menu tab on the top left hand corner was missing.??? How can I print without a menu tab? How do I restore the menu tab?
-
Can't find files either with Spotlight or Finder
So (for example) I just created a file (with Photoshop) called "duellingremotes.jpg" and it's in a folder in another folder on the Desktop. Nothing comes up when I search for "remote" either in Spotlight or by going Command-F. Is this not one of the