I'm running this code:
<?php
$dbport = 1578;
$dbhost = "localhost";
$dbname = "dbname";
$dbuser = "dbuser";
$dbpswd = "dbpswd";
$MySQLLink = mysqli_connect($dbhost, $dbuser, $dbpswd, $dbname, $dbport);
$query = "SELECT * FROM assets_advanced_records LIMIT 100000";
echo "running query ".$query."<br>";
$result = mysqli_query($MySQLLink, $query) or die("Query failed (".$query."): ".mysqli_error($MySQLLink));
echo "query succeeded<br>";
mysqli_close($MySQLLink);
?>
Execution stops at mysqli_query() immediately; the page is no longer loading.
Output looks like this:
running query SELECT * FROM assets_advanced_records LIMIT 100000
If I reduce LIMIT to 10000 I get the correct output:
running query SELECT * FROM assets_advanced_records LIMIT 10000
query succeeded
What could be causing this?
MySQL version: 5.7.12-0ubuntu1.1
PHP version: 7.0.8-0ubuntu0.16.04.3
I get this in the console when execution stops:
Failed to load resource: the server responded with a status of 500 (Internal Server Error)
UPDATE:
Checking /var/log/apache2/error.log I'm getting errors like:
[Fri Dec 30 15:13:23.983920 2016] [:error] [pid 1907] [client 10.10.6.116:54978] FastCGI: server "/usr/lib/cgi-bin/php7-fcgi" stderr: PHP message: PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 806912 bytes) in /var/www/html/debug_tools2.php on line 491, referer: http://10.10.6.24/debug_tools2.php