This may be fairly odd architecture with how this script is ultimately being ran.
I'm attempting to run a PHP script through an Enterprise job scheduler client on Windows, with an Agent on Fedora Linux. I have Apache/PHP/MySQL configured properly. I was originally having issues determining the path to place the config file on Fedora but determined it needed to be placed in /usr/share/php.
The issue I'm having however, is my script is just printing the include file information in the script, rather than simply utilizing the variables within it for the MySQL DB.
So the config.php file is fairly straight forward and just contains:
<?
$host = "0.0.0.0";
$username = "root";
$password = "*****";
$db = "processid";
?>
The script itself is:
<?include '/usr/share/php/config.php'; $con = mysqli_connect('$host','$username','$password','$db'); // Check connectionif (mysqli_connect_errno()){ echo "Failed to connect to MySQL: " . mysqli_connect_error();} for($x = 0; $x < 15; $x++) {mysqli_query($con,"INSERT INTO idnumbers (ID)VALUES ('$x')");} mysqli_close($con);?>
The output from my job scheduler is:
<?
$host = "0.0.0.0";
$username = "root";
$password = "****";
db = "processid";
?>
PHP Warning: mysqli_connect(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /root/.jams/job/07/cd0400-9b56-4409-a49b-52dc5b425016 on line 5
PHP Warning: mysqli_connect(): (HY000/2002): php_network_getaddresses: getaddrinfo failed: Name or service not known in /root/.jams/job/07/cd0400-9b56-4409-a49b-52dc5b425016 on line 5
Failed to connect to MySQL: php_network_getaddresses: getaddrinfo failed: Name or service not knownPHP Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in /root/.jams/job/07/cd0400-9b56-4409-a49b-52dc5b425016 on line 15
PHP Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in /root/.jams/job/07/cd0400-9b56-4409-a49b-52dc5b425016 on line 15
PHP Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in /root/.jams/job/07/cd0400-9b56-4409-a49b-52dc5b425016 on line 15
PHP Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in /root/.jams/job/07/cd0400-9b56-4409-a49b-52dc5b425016 on line 15
PHP Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in /root/.jams/job/07/cd0400-9b56-4409-a49b-52dc5b425016 on line 15
PHP Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in /root/.jams/job/07/cd0400-9b56-4409-a49b-52dc5b425016 on line 15
PHP Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in /root/.jams/job/07/cd0400-9b56-4409-a49b-52dc5b425016 on line 15
PHP Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in /root/.jams/job/07/cd0400-9b56-4409-a49b-52dc5b425016 on line 15
PHP Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in /root/.jams/job/07/cd0400-9b56-4409-a49b-52dc5b425016 on line 15
PHP Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in /root/.jams/job/07/cd0400-9b56-4409-a49b-52dc5b425016 on line 15
PHP Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in /root/.jams/job/07/cd0400-9b56-4409-a49b-52dc5b425016 on line 15
PHP Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in /root/.jams/job/07/cd0400-9b56-4409-a49b-52dc5b425016 on line 15
PHP Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in /root/.jams/job/07/cd0400-9b56-4409-a49b-52dc5b425016 on line 15
PHP Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in /root/.jams/job/07/cd0400-9b56-4409-a49b-52dc5b425016 on line 15
PHP Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in /root/.jams/job/07/cd0400-9b56-4409-a49b-52dc5b425016 on line 15
PHP Warning: mysqli_close() expects parameter 1 to be mysqli, boolean given in /root/.jams/job/07/cd0400-9b56-4409-a49b-52dc5b425016 on line 18