php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36169 mysql_connet not work under exec (system, passthru,etc)
Submitted: 2006-01-26 17:13 UTC Modified: 2006-01-27 08:39 UTC
From: admin at ipfree dot ru Assigned:
Status: Not a bug Package: MySQL related
PHP Version: 5.1.2 OS: Linux Fedora4
Private report: No CVE-ID: None
 [2006-01-26 17:13 UTC] admin at ipfree dot ru
Description:
------------
If mysql_conect executed from script, run from Apache->php exec
program die without notice

Reproduce code:
---------------
WEB script (run under apache)
------------------------------
echo "<pre>Begin\n";
echo exec("php /www/public_html/tst2.php");
------------------------------

tst2.php
---------------------
echo "[1";
mysql_pconnect("localhost:3306", "titan", "qazxdr");
echo "2]";

----------------------

Expected result:
----------------
Begin
[1


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-01-26 17:17 UTC] tony2001@php.net
Add error_reporting(E_ALL) and ini_set('display_errors', 1); in the beginning of tst2.php.
 [2006-01-26 21:06 UTC] admin at ipfree dot ru
After put 
error_reporting(E_ALL); 
ini_set('display_errors', 1);
in tst2.php I get this error:

<pre>Begin
[1
Fatal error: Call to undefined function mysql_pconnect() in /www/public_html/tst2.php on line 6

But, I can use mysql_pconnect (and mysql_connect - I try both) from WEB script and tst1.php run correctly (I check with addition code with sql query) from shell command line
(cgi mode of php)
 [2006-01-26 21:07 UTC] admin at ipfree dot ru
Sorry, tst2.php work correctly from commend line
 [2006-01-27 08:39 UTC] sniper@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Sep 15 03:00:01 2025 UTC