I have an error on upload files with aprox 130.000 rows (23MB). The code works good with small files but when I try to upload bigger ones this error always comes out. I have already tried the cell caching method to reduce memory usage but the error remains. In my php.ini the parameters are memory_limit=128M / upload_max_filesize=64M / post_max_size=64M.
Warning: simplexml_load_string(): Memory allocation failed in C:\xampp\htdocs\lib\PHPExcel\Reader\Excel2007.php on line 652
Warning: simplexml_load_string(): Entity: line 2: parser error : Memory allocation failed : xmlSAX2Characters in C:\xampp\htdocs\lib\PHPExcel\Reader\Excel2007.php on line 652
Warning: simplexml_load_string(): "><c r="I935190" s="9"/></row><row r="935191" spans="9:9" x14ac:dyDescent="0.25" in C:\xampp\htdocs\lib\PHPExcel\Reader\Excel2007.php on line 652
Warning: simplexml_load_string(): ^ in C:\xampp\htdocs\lib\PHPExcel\Reader\Excel2007.php on line 652
Warning: simplexml_load_string(): Memory allocation failed : building attribute in C:\xampp\htdocs\lib\PHPExcel\Reader\Excel2007.php on line 652
Warning: simplexml_load_string(): Memory allocation failed : building attribute in C:\xampp\htdocs\lib\PHPExcel\Reader\Excel2007.php on line 652
Warning: simplexml_load_string(): Memory allocation failed in C:\xampp\htdocs\lib\PHPExcel\Reader\Excel2007.php on line 652
Warning: simplexml_load_string(): Entity: line 2: parser error : Extra content at the end of the document in C:\xampp\htdocs\lib\PHPExcel\Reader\Excel2007.php on line 652
Warning: simplexml_load_string(): "><c r="I935190" s="9"/></row><row r="935191" spans="9:9" x14ac:dyDescent="0.25" in C:\xampp\htdocs\lib\PHPExcel\Reader\Excel2007.php on line 652
And when I try the uploading again it appear:
Warning: simplexml_load_string(): Memory allocation failed : growing buffer in C:\xampp\htdocs\lib\PHPExcel\Reader\Excel2007.php on line 652
Warning: simplexml_load_string(): Memory allocation failed : growing buffer in C:\xampp\htdocs\lib\PHPExcel\Reader\Excel2007.php on line 652
A piece of the php code, all warnigs appear on the 9th line when I load the file:
$total = count($_FILES["file"]["name"]);
for($j=0; $j<$total; $j++){
$tmpFilePath =$_FILES["file"]["tmp_name"][$j];
if ($tmpFilePath != ""){
$newFilePath = 'ficheros/'. $_FILES["file"]["name"][$j];
}
if(move_uploaded_file($tmpFilePath, $newFilePath)){
$objReader = PHPExcel_IOFactory::createReader('Excel2007');
$objReader->setReadDataOnly(true);
$objPHPExcel = $objReader->load($newFilePath);
$sheetCount = $objPHPExcel ->getSheetCount();
$sheetNames = $objPHPExcel -> getSheetNames();
$objWorksheet = $objPHPExcel -> getSheetByName("Sheet1");
$highestRow = $objWorksheet->getHighestRow();
$highestColumn = $objWorksheet->getHighestColumn();
$highestColumnIndex = PHPExcel_Cell::columnIndexFromString($highestColumn);
$rows = array();
for ($row = 2; $row <= $highestRow; ++$row) {
for ($col = 0; $col <= $highestColumnIndex; ++$col) {
$rows[$col] = $objWorksheet->getCellByColumnAndRow($col, $row)->getCalculatedValue();
}
mysql_query..
}
}
Thanks in advance
Related
I'm trying to create a PDF from post content, including some ACF fields. Currently I've got it working on a POST form and dynamically creating a PDF each time, but I'd like to make it generate the PDF on saving the post so I can then just have a download button which downloads the PDF generated from saving the post, but having difficulty doing so. Any help would be grand!
I've tried to create this as a function in functions.php hooking into the acf/save_post action at prioirty 15 so it's after the initial save.
function vehicle_details_pdf( $post_id ) {
require('wp-content/themes/murrayscott-nelson/fpdf/fpdf.php');
class PDF extends FPDF
{
function Header()
{
$vehicleRef = $_POST['ref'];
$this->Image('wp-content/themes/murrayscott-nelson/assets/logo.jpg',10,10,80);
$this->SetFont('Arial','B',15);
$this->Cell(80);
$this->Cell(85,10,'Vehicle Details - Ref:' . $vehicleRef ,0,0,'R');
$this->Ln(20);
}
function Footer()
{
$this->SetY(-15);
$this->SetFont('Arial','I',8);
$this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');
}
$vehicleName = get_the_title();
$vehicleBodyStyle = get_field('body_type', $post_id);
$vehiclePrice = get_field('price', $post_id);
$vehicleEngCap = get_field('engine_capacity', $post_id);
$vehicleMileage = get_field('mileage', $post_id);
$vehicleSteering = get_field('steering', $post_id);
$vehicleDescription = get_field('description', $post_id);
$vehicleRef = get_field('reg_ref', $post_id);
$images = get_field('vehicle_images', $post_id);
$image = $images[0];
$image = $image['url'];
$vehicleImage = preg_replace("/^https:/i", "http:", $image);
$pdf = new PDF();
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->SetFont('Arial','B',17);
$pdf->Image( $vehicleImage, $pdf->GetX(), $pdf->GetY(), 190);
$pdf->Ln(130);
$pdf->Cell(0,10,$vehicleName);
$pdf->Ln(10);
$pdf->SetFont('Arial','',12);
$pdf->Cell(0,7,'Body Style: ' . $vehicleBodyStyle . ' | Steering: ' . $vehicleSteering . ' | Engine Capacity: ' . $vehicleEngineCap . 'cc | Mileage: ' . $vehicleMileage . ' miles' );
$pdf->Ln(7);
$pdf->Write (6, $vehicleDescription);
$pdf->SetFont('Arial','B',17);
$pdf->Ln(0);
$pdf->Cell( 0, 10, iconv("UTF-8", "ISO-8859-1", "£") . $vehiclePrice, 0);
$pdf->Ln(10);
$pdf->setFillColor(230,230,230);
$pdf->SetFont('Arial','B',15);
$pdf->MultiCell(0,7,"If you'd like to arrange a viewing please call 01723 361 227",0,'C',1);
$pdf->MultiCell(0,7,"quoting reference: " . $vehicleRef ,0,'C',1);
$pdf->setFillColor(38,54,29);
$pdf->setTextColor(255,255,255);
$pdf->Ln(5);
$pdf->MultiCell(0,7,"Finance Available - Ask for details" ,0,'C',1);
$pdf->setTextColor(0,0,0);
$filepath= wp_get_upload_dir() . '/vehicledetails/' ;
$pdf->Output('F', $filepath . $vehicleRef . '.pdf');
}
add_action('acf/save_post', 'vehicle_details_pdf', 15);
I expect the code to create a pdf file in the wp-content/uploads/vehicledetails directory
error messages:
[01-Sep-2019 10:49:10 UTC] PHP Warning: Invalid argument supplied for
foreach() in /app/public/wp-includes/class-wp-post-type.php on line
597 [01-Sep-2019 10:49:10 UTC] PHP Warning: Invalid argument supplied
for foreach() in /app/public/wp-includes/class-wp-post-type.php on
line 597 [01-Sep-2019 10:49:15 UTC] PHP Warning: Invalid argument
supplied for foreach() in
/app/public/wp-includes/class-wp-post-type.php on line 597
[01-Sep-2019 10:49:15 UTC] PHP Warning: Invalid argument supplied for
foreach() in /app/public/wp-includes/class-wp-post-type.php on line
597 [01-Sep-2019 10:49:17 UTC] PHP Warning: Invalid argument supplied
for foreach() in /app/public/wp-includes/class-wp-post-type.php on
line 597 [01-Sep-2019 10:49:17 UTC] PHP Warning: Invalid argument
supplied for foreach() in
/app/public/wp-includes/class-wp-post-type.php on line 597
[01-Sep-2019 10:49:17 UTC] PHP Warning: Invalid argument supplied for
foreach() in /app/public/wp-includes/class-wp-post-type.php on line
597 [01-Sep-2019 10:49:18 UTC] PHP Warning: Invalid argument supplied
for foreach() in /app/public/wp-includes/class-wp-post-type.php on
line 597 [01-Sep-2019 10:49:19 UTC] PHP Warning: Invalid argument
supplied for foreach() in
/app/public/wp-includes/class-wp-post-type.php on line 597
[01-Sep-2019 10:49:19 UTC] PHP Warning: Invalid argument supplied for
foreach() in /app/public/wp-includes/class-wp-post-type.php on line
597 [01-Sep-2019 10:49:20 UTC] PHP Warning: Invalid argument supplied
for foreach() in /app/public/wp-includes/class-wp-post-type.php on
line 597 [01-Sep-2019 10:49:20 UTC] PHP Warning: Invalid argument
supplied for foreach() in
/app/public/wp-includes/class-wp-post-type.php on line 597
[01-Sep-2019 10:49:21 UTC] PHP Warning:
require(wp-content/themes/murrayscott-nelson/fpdf/fpdf.php): failed to
open stream: No such file or directory in
/app/public/wp-content/themes/murrayscott-nelson/functions.php on line
81 [01-Sep-2019 10:49:21 UTC] PHP Warning:
require(wp-content/themes/murrayscott-nelson/fpdf/fpdf.php): failed to
open stream: No such file or directory in
/app/public/wp-content/themes/murrayscott-nelson/functions.php on line
81 [01-Sep-2019 10:49:21 UTC] PHP Fatal error: require(): Failed
opening required 'wp-content/themes/murrayscott-nelson/fpdf/fpdf.php'
(include_path='.:/usr/share/php:/www/wp-content/pear') in
/app/public/wp-content/themes/murrayscott-nelson/functions.php on line
81 [01-Sep-2019 10:49:21 UTC] PHP Fatal error: require(): Failed
opening required 'wp-content/themes/murrayscott-nelson/fpdf/fpdf.php'
(include_path='.:/usr/share/php:/www/wp-content/pear') in
/app/public/wp-content/themes/murrayscott-nelson/functions.php on line
81 [01-Sep-2019 10:50:16 UTC] PHP Warning: Invalid argument supplied
for foreach() in /app/public/wp-includes/class-wp-post-type.php on
line 597 [01-Sep-2019 10:52:17 UTC] PHP Warning: Invalid argument
supplied for foreach() in
/app/public/wp-includes/class-wp-post-type.php on line 597
[01-Sep-2019 10:54:18 UTC] PHP Warning: Invalid argument supplied for
foreach() in /app/public/wp-includes/class-wp-post-type.php on line
597 [01-Sep-2019 10:56:18 UTC] PHP Parse error: syntax error,
unexpected '$vehicleName' (T_VARIABLE), expecting function
(T_FUNCTION) or const (T_CONST) in
/app/public/wp-content/themes/murrayscott-nelson/functions.php on line
114 [01-Sep-2019 10:58:19 UTC] PHP Parse error: syntax error,
unexpected '$vehicleName' (T_VARIABLE), expecting function
(T_FUNCTION) or const (T_CONST) in
/app/public/wp-content/themes/murrayscott-nelson/functions.php on line
114
Your upload directory is not set correctly.
Try this:
$uploads = wp_upload_dir();
$pdf->Output('F', $uploads['basedir'] . '/vehicledetails/' . $vehicleRef . '.pdf');
I'm trying to open an Excel file (.xlsx) that is protected by a password with PHPSpreadsheet (documentation). I know the password but I don't find a way to open it.
The load()method of \PhpOffice\PhpSpreadsheet\Reader\Xlsx doesn't give the possibility to insert a password and when I try to load the file it returns an error (of course).
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
$reader = new \PhpOffice\PhpSpreadsheet\Reader\Xlsx();
$spreadsheet = $reader->load('hello world.xlsx');
$sheet = $spreadsheet->getActiveSheet();
echo $sheet->getCell('A1')->getValue() . "\n";
And here is the error
Warning: ZipArchive::getFromName(): Invalid or uninitialized Zip object in /PHPOffice/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx.php on line 311
Warning: ZipArchive::getFromName(): Invalid or uninitialized Zip object in /PHPOffice/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx.php on line 313
Warning: Invalid argument supplied for foreach() in /PHPOffice/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx.php on line 350
Warning: ZipArchive::getFromName(): Invalid or uninitialized Zip object in /PHPOffice/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx.php on line 311
Warning: ZipArchive::getFromName(): Invalid or uninitialized Zip object in /PHPOffice/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx.php on line 313
Warning: Invalid argument supplied for foreach() in /PHPOffice/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx.php on line 397
Warning: ZipArchive::getFromName(): Invalid or uninitialized Zip object in /PHPOffice/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx.php on line 311
Warning: ZipArchive::getFromName(): Invalid or uninitialized Zip object in /PHPOffice/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx.php on line 313
Warning: Invalid argument supplied for foreach() in /PHPOffice/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx.php on line 1855
Warning: ZipArchive::close(): Invalid or uninitialized Zip object in /PHPOffice/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx.php on line 1883
How can this code deal with passwords?
I welcome you to check out my PHPDecryptXLSXWithPassword repo.
It also works for DOCX/PPTX files, but this answer is specific to your question: first decrypt the file with password, and then use the decrypted file with PHPSpreadsheet.
Here is an example:
require_once('PHPDecryptXLSXWithPassword.php');
$encryptedFilePath = 'hello world.xlsx';
$password = 'mypassword'; // password to "open" the file
$decryptedFilePath = 'temp_path_to_decrypted_file.xlsx';
decrypt($encryptedFilePath, $password, $decryptedFilePath);
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
$reader = new \PhpOffice\PhpSpreadsheet\Reader\Xlsx();
$spreadsheet = $reader->load($decryptedFilePath);
$sheet = $spreadsheet->getActiveSheet();
echo $sheet->getCell('A1')->getValue() . "\n";
Note: This is an experimental code, so use with caution. DO NOT use in production!
At this moment i can't try but, I suppose that you have to do something like this:
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
$reader = new \PhpOffice\PhpSpreadsheet\Reader\Xlsx();
$spreadsheet = $reader->load('hello world.xlsx');
$sheet = $spreadsheet->getActiveSheet();
$sheet->getProtection()->setSheet(true);
$sheet->getProtection()->setPassword('THEPASSWORD');
echo $sheet->getCell('A1')->getValue() . "\n";
I'm not sure, tomorrow I will be to the office and can try.
So I inherited a product reviews module. A cron runs every 6 hours. It checks for when to send an email out, but has not been working as of late.
Here's the config.xml file part containing the crontab. The crontab node is only placed within .
<crontab>
<jobs>
<company_reviews_delay>
<schedule>
<cron_expr>* * * * *</cron_expr><!-- every 6 hours -->
</schedule>
<run>
<model>reviews/adminhtml_observer::delaySend</model>
</run>
</company_reviews_delay>
</jobs>
</crontab>
The php file with the delaySend method is in Reviews/Model/Adminhtml/Observer.php
Here's the code for it
public function delaySend() {
$error_counter = 0;
$unsent_notifications = $this->getNotificationCollection()->addFieldToFilter('notified', array('lt' => 1));
foreach($unsent_notifications as $notification){
try{
$order = Mage::getModel('sales/order')->loadByIncrementId($notification->getOrderId());
if(!$this->getConfig()->isCronEnabled($order->getStoreId()) || !$this->getConfig()->isEnabled($order->getStoreId())){
continue; //skip for store that is disabled
}
$shipments_collection = $order->getShipmentsCollection();
if (empty($shipments_collection)) continue;
$shipment = $shipments_collection->getFirstItem();
}catch(Exception $e){
if($error_counter == 0){
mage::helper('mymodule_base')->logError('Review delay send error: ' . $e, true);
}
mage::helper('mymodule_base')->logError('Issue with notification order ID: ' . $notification->getOrderId(), false);
$error_counter++;
continue;
}
$execution_time = strtotime($shipment->getCreatedAt().'+'. $this->getConfig()->getCronDelay($order->getStoreId())); //e.g (+1 day to shipping date)
if($execution_time < time()){
$notification->sendEmail($order->getStoreId());
}
}
return $this;
}
I substituted a simple print "Hello"; command in the method and ran it on command line. Hello was printed out but we get this error:
2015-07-22T15:48:54+00:00 ERR (3): Warning: include(Symfony\Component\Console\Event\ConsoleTerminateEvent.php): failed to open stream: No such file or directory in /home/os2/public_html/lib/Varien/Autoload.php on line 94
2015-07-22T15:48:54+00:00 ERR (3): Warning: include(Symfony\Component\Console\Event\ConsoleTerminateEvent.php): failed to open stream: No such file or directory in /home/os2/public_html/lib/Varien/Autoload.php on line 94
2015-07-22T15:48:54+00:00 ERR (3): Warning: include(): Failed opening 'Symfony\Component\Console\Event\ConsoleTerminateEvent.php' for inclusion (include_path='/home/os2/public_html/app/code/local:/home/os2/public_html/app/code/community:/home/os2/public_html/app/code/core:/home/os2/public_html/lib:.:/usr/lib/php:/usr/local/lib/php') in /home/os2/public_html/lib/Varien/Autoload.php on line 94
Can anyone offer some advice or help? Thanks.
I am using this code
$userName=$this->input->post('user');
$password=$this->input->post('pass');
$lineNumber=$this->input->post('line');
$to= $this->input->post('Receiver');
$text=$this->input->post('messageBody');;
$client= new SoapClient('http://n.sms.ir/ws/SendReceive.asmx?wsdl');
$parameters['userName'] = $userName;
$parameters['password'] = $password;
$parameters['mobileNos'] = array(doubleval($to));
$parameters['messages'] = array($text);
$parameters['lineNumber'] = $lineNumber;
$parameters['sendDateTime'] = date("Y-m-d")."T".date("H:i:s");
print_r($client->SendMessageWithLineNumber($parameters));
But this happens
A PHP Error was encountered
Severity: Warning
Message:
SoapClient::SoapClient(http://n.sms.ir/ws/SendReceive.asmx?wsdl):
failed to open stream: Connection timed out
Filename: views/sms.php
Line Number: 19
and
A PHP Error was encountered
Severity: Warning
Message: SoapClient::SoapClient(): I/O warning : failed to load
external entity "http://n.sms.ir/ws/SendReceive.asmx?wsdl"
Filename: views/sms.php
Line Number: 19
Does anyone know what's wrong?
go to file system/core/CodeIgniter.php and increase set_time_limit by default it set 300
if (function_exists("set_time_limit") == TRUE AND #ini_get("safe_mode") == 0)
{
#set_time_limit(300);//increase it according to your requirement
}
http://reps.michebagshows.com/forums/
Recently, our customer forums popped up with this slew of errors from settings.php in the Vanilla forum software. We have no idea how this happened, as none of the files have been modified for months. Todd over at Vanilla suggested that the permissions changed, but those haven't been touched either. He then sent me to another user for help, who hasn't even logged in in a week.
How can this be fixed? We're getting quite a few complaints about it because the forums are the way our customers trade and discuss our product among each other.
Any help would be greatly appreciated, thank you.
Example errors:
Warning: include_once(/path/to/vanilla/appg/database.php) [function.include-once]: failed to open stream: No such file or directory in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 244
Warning: include_once() [function.include]: Failed opening '/path/to/vanilla/appg/database.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 244
Warning: include_once(/path/to/your/database/file.php) [function.include-once]: failed to open stream: No such file or directory in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 245
Warning: include_once() [function.include]: Failed opening '/path/to/your/database/file.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 245
Warning: include_once(/path/to/your/library/Framework/Framework.Functions.php) [function.include-once]: failed to open stream: No such file or directory in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 246
Warning: include_once() [function.include]: Failed opening '/path/to/your/library/Framework/Framework.Functions.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 246
Warning: include_once(/path/to/your/library/Framework/Framework.Class.Database.php) [function.include-once]: failed to open stream: No such file or directory in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 247
Warning: include_once() [function.include]: Failed opening '/path/to/your/library/Framework/Framework.Class.Database.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 247
Warning: include_once(/path/to/your/library/Framework/Framework.Class.MySQL.php) [function.include-once]: failed to open stream: No such file or directory in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 248
Warning: include_once() [function.include]: Failed opening '/path/to/your/library/Framework/Framework.Class.MySQL.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 248
Warning: include_once(/path/to/your/library/Framework/Framework.Class.SqlBuilder.php) [function.include-once]: failed to open stream: No such file or directory in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 249
Warning: include_once() [function.include]: Failed opening '/path/to/your/library/Framework/Framework.Class.SqlBuilder.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 249
Warning: include_once(/path/to/your/library/Framework/Framework.Class.MessageCollector.php) [function.include-once]: failed to open stream: No such file or directory in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 250
Warning: include_once() [function.include]: Failed opening '/path/to/your/library/Framework/Framework.Class.MessageCollector.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 250
Warning: include_once(/path/to/your/library/Framework/Framework.Class.ErrorManager.php) [function.include-once]: failed to open stream: No such file or directory in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 251
Warning: include_once() [function.include]: Failed opening '/path/to/your/library/Framework/Framework.Class.ErrorManager.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 251
Warning: include_once(/path/to/your/library/Framework/Framework.Class.ObjectFactory.php) [function.include-once]: failed to open stream: No such file or directory in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 252
Warning: include_once() [function.include]: Failed opening '/path/to/your/library/Framework/Framework.Class.ObjectFactory.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 252
Warning: include_once(/path/to/your/library/Framework/Framework.Class.StringManipulator.php) [function.include-once]: failed to open stream: No such file or directory in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 253
Warning: include_once() [function.include]: Failed opening '/path/to/your/library/Framework/Framework.Class.StringManipulator.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 253
Warning: include_once(/path/to/your/library/Framework/Framework.Class.Context.php) [function.include-once]: failed to open stream: No such file or directory in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 254
Warning: include_once() [function.include]: Failed opening '/path/to/your/library/Framework/Framework.Class.Context.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 254
Warning: include_once(/path/to/your/library/Framework/Framework.Class.Delegation.php) [function.include-once]: failed to open stream: No such file or directory in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 255
Warning: include_once() [function.include]: Failed opening '/path/to/your/library/Framework/Framework.Class.Delegation.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 255
Warning: include_once(/path/to/your/library/Vanilla/Vanilla.Functions.php) [function.include-once]: failed to open stream: No such file or directory in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 256
Warning: include_once() [function.include]: Failed opening '/path/to/your/library/Vanilla/Vanilla.Functions.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 256
Warning: include_once(/path/to/your/library/People/People.Class.Authenticator.php) [function.include-once]: failed to open stream: No such file or directory in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 257
Warning: include_once() [function.include]: Failed opening '/path/to/your/library/People/People.Class.Authenticator.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 257
Warning: include_once(/path/to/your/library/People/People.Class.Session.php) [function.include-once]: failed to open stream: No such file or directory in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 258
Warning: include_once() [function.include]: Failed opening '/path/to/your/library/People/People.Class.Session.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 258
Warning: include_once(/path/to/your/library/People/People.Class.PasswordHash.php) [function.include-once]: failed to open stream: No such file or directory in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 259
Warning: include_once() [function.include]: Failed opening '/path/to/your/library/People/People.Class.PasswordHash.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 259
Warning: include_once(/path/to/your/library/People/People.Class.User.php) [function.include-once]: failed to open stream: No such file or directory in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 260
Warning: include_once() [function.include]: Failed opening '/path/to/your/library/People/People.Class.User.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 260
Fatal error: Class 'Context' not found in /var/www/michebagshows.com/rep_forums/forums/appg/settings.php on line 262
Settings.php
<?php
/*
* Copyright 2003 Mark O'Sullivan
* This file is part of Vanilla.
* Vanilla is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
* Vanilla 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. See the GNU General Public License for more details.
* You should have received a copy of the GNU General Public License along with Vanilla; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* The latest source code for Vanilla is available at www.lussumo.com
* Contact Mark O'Sullivan at mark [at] lussumo [dot] com
* Description: Global application constants
* ATTENTION: !DO NOT CHANGE ANYTHING IN THIS FILE!
* If you wish to override any configuration setting, do it in the
* conf/settings.php file. This file will be overwritten when you apply upgrades
* to Vanilla. The conf/settings.php file will NOT be overwritten.
*/
ob_start();
$Configuration = array();
// Database Settings
$Configuration['DATABASE_SERVER'] = 'MySQL';
$Configuration['DATABASE_TABLE_PREFIX'] = 'LUM_';
$Configuration['DATABASE_HOST'] = 'localhost';
$Configuration['DATABASE_NAME'] = 'your_vanilla_database_name';
$Configuration['DATABASE_USER'] = 'your_vanilla_database_user_name';
$Configuration['DATABASE_PASSWORD'] = 'your_vanilla_database_password';
$Configuration['FARM_DATABASE_HOST'] = '';
$Configuration['FARM_DATABASE_NAME'] = 'your_farm_database_name';
$Configuration['FARM_DATABASE_USER'] = 'your_farm_database_user_name';
$Configuration['FARM_DATABASE_PASSWORD'] = 'your_farm_database_password';
$Configuration['DATABASE_CHARACTER_ENCODING'] = '';
$Configuration['DATABASE_VERSION'] = '1';
// Path Settings
$Configuration['APPLICATION_PATH'] = '/path/to/vanilla/';
$Configuration['DATABASE_PATH'] = '/path/to/your/database/file.php';
$Configuration['LIBRARY_PATH'] = '/path/to/your/library/';
$Configuration['EXTENSIONS_PATH'] = '/path/to/your/extensions/';
$Configuration['LANGUAGES_PATH'] = '/path/to/your/languages/';
$Configuration['THEME_PATH'] = '/path/to/vanilla/themes/vanilla/';
$Configuration['BASE_URL'] = 'http://your.base.url/to/vanilla/';
$Configuration['DEFAULT_STYLE'] = '/vanilla/themes/vanilla/styles/default/';
$Configuration['WEB_ROOT'] = '/vanilla/';
$Configuration['SIGNIN_URL'] = 'people.php';
$Configuration['SIGNOUT_URL'] = 'people.php?PostBackAction=SignOutNow';
// People Settings
$Configuration['AUTHENTICATION_MODULE'] = 'People/People.Class.Authenticator.php';
$Configuration['AUTHENTICATION_CLASS'] = 'Authenticator';
$Configuration['SESSION_NAME'] = '';
$Configuration['COOKIE_USER_KEY'] = 'lussumocookieone';
$Configuration['COOKIE_VERIFICATION_KEY'] = 'lussumocookietwo';
$Configuration['SESSION_USER_IDENTIFIER'] = 'LussumoUserID';
$Configuration['COOKIE_DOMAIN'] = '.domain.com';
$Configuration['COOKIE_PATH'] = '/';
$Configuration['SUPPORT_EMAIL'] = 'support#domain.com';
$Configuration['SUPPORT_NAME'] = 'Support';
$Configuration['LOG_ALL_IPS'] = '0';
$Configuration['FORWARD_VALIDATED_USER_URL'] = './';
$Configuration['ALLOW_IMMEDIATE_ACCESS'] = '0';
$Configuration['DEFAULT_ROLE'] = '0';
$Configuration['APPROVAL_ROLE'] = '3';
$Configuration['SAFE_REDIRECT'] = 'people.php?PageAction=SignOutNow';
$Configuration['PEOPLE_USE_EXTENSIONS'] = '1';
$Configuration['DEFAULT_EMAIL_VISIBLE'] = '0';
$Configuration['PASSWORD_HASH_ITERATION'] = '8';
$Configuration['PASSWORD_HASH_PORTABLE'] = '1';
// Framework Settings
$Configuration['SMTP_HOST'] = '';
$Configuration['SMTP_USER'] = '';
$Configuration['SMTP_PASSWORD'] = '';
$Configuration['DEFAULT_EMAIL_MIME_TYPE'] = 'text/plain';
$Configuration['LANGUAGE'] = "English";
$Configuration['URL_BUILDING_METHOD'] = 'Standard'; // Standard or mod_rewrite
$Configuration['CHARSET'] = 'utf-8';
$Configuration['PAGE_EVENTS'] = array('Page_Init', 'Page_Render', 'Page_Unload');
$Configuration['PAGELIST_NUMERIC_TEXT'] = '0';
$Configuration['LIBRARY_NAMESPACE_ARRAY'] = array('Framework', 'People', 'Vanilla');
$Configuration['LIBRARY_INCLUDE_PATH'] = '%LIBRARY%';
$Configuration['DEFAULT_FORMAT_TYPE'] = 'Text';
$Configuration['FORMAT_TYPES'] = array('Text');
$Configuration['APPLICATION_TITLE'] = 'Vanilla';
$Configuration['BANNER_TITLE'] = 'Vanilla';
$Configuration['UPDATE_REMINDER'] = 'Monthly';
$Configuration['LAST_UPDATE'] = '';
$Configuration['HTTP_METHOD'] = 'http'; // Could alternately be https
// Vanilla Settings
$Configuration['ENABLE_WHISPERS'] = '0';
$Configuration['DISCUSSIONS_PER_PAGE'] = '30';
$Configuration['COMMENTS_PER_PAGE'] = '50';
$Configuration['SEARCH_RESULTS_PER_PAGE'] = '30';
$Configuration['ALLOW_NAME_CHANGE'] = '1';
$Configuration['ALLOW_EMAIL_CHANGE'] = '1';
$Configuration['ALLOW_PASSWORD_CHANGE'] = '1';
$Configuration['USE_REAL_NAMES'] = '1';
$Configuration['PUBLIC_BROWSING'] = '1';
$Configuration['USE_CATEGORIES'] = '1';
$Configuration['MAX_COMMENT_LENGTH'] = '5000';
$Configuration['MAX_TOPIC_WORD_LENGTH'] = '45';
$Configuration['DISCUSSION_POST_THRESHOLD'] = '3';
$Configuration['DISCUSSION_TIME_THRESHOLD'] = '60';
$Configuration['DISCUSSION_THRESHOLD_PUNISHMENT'] = '120';
$Configuration['COMMENT_POST_THRESHOLD'] = '5';
$Configuration['COMMENT_TIME_THRESHOLD'] = '60';
$Configuration['COMMENT_THRESHOLD_PUNISHMENT'] = '120';
$Configuration['UPDATE_URL'] = 'http://lussumo.com/updatecheck/default.php';
// Vanilla Control Positions
$Configuration['CONTROL_POSITION_HEAD'] = '100';
$Configuration['CONTROL_POSITION_MENU'] = '200';
$Configuration['CONTROL_POSITION_BANNER'] = '200';
$Configuration['CONTROL_POSITION_PANEL'] = '300';
$Configuration['CONTROL_POSITION_NOTICES'] = '400';
$Configuration['CONTROL_POSITION_BODY_ITEM'] = '500';
$Configuration['CONTROL_POSITION_FOOT'] = '600';
$Configuration['CONTROL_POSITION_PAGE_END'] = '700';
// Vanilla Tab Positions
$Configuration['TAB_POSITION_DISCUSSIONS'] = '10';
$Configuration['TAB_POSITION_CATEGORIES'] = '20';
$Configuration['TAB_POSITION_SEARCH'] = '30';
$Configuration['TAB_POSITION_SETTINGS'] = '40';
$Configuration['TAB_POSITION_ACCOUNT'] = '50';
// Url Rewriting Definitions
$Configuration['REWRITE_categories.php'] = 'categories/';
$Configuration['REWRITE_index.php'] = 'discussions/';
$Configuration['REWRITE_comments.php'] = 'discussion/';
$Configuration['REWRITE_search.php'] = 'search/';
$Configuration['REWRITE_account.php'] = 'account/';
$Configuration['REWRITE_settings.php'] = 'settings/';
$Configuration['REWRITE_post.php'] = 'post/';
$Configuration['REWRITE_people.php'] = 'people/';
$Configuration['REWRITE_extension.php'] = 'extension/';
// Default values for role permissions
// Standard Permissions
$Configuration['PERMISSION_SIGN_IN'] = '0';
$Configuration['PERMISSION_ADD_COMMENTS'] = '0';
$Configuration['PERMISSION_START_DISCUSSION'] = '0';
$Configuration['PERMISSION_HTML_ALLOWED'] = '0';
// Discussion Moderator Permissions
$Configuration['PERMISSION_SINK_DISCUSSIONS'] = '0';
$Configuration['PERMISSION_STICK_DISCUSSIONS'] = '0';
$Configuration['PERMISSION_HIDE_DISCUSSIONS'] = '0';
$Configuration['PERMISSION_CLOSE_DISCUSSIONS'] = '0';
$Configuration['PERMISSION_EDIT_DISCUSSIONS'] = '0';
$Configuration['PERMISSION_VIEW_HIDDEN_DISCUSSIONS'] = '0';
$Configuration['PERMISSION_EDIT_COMMENTS'] = '0';
$Configuration['PERMISSION_HIDE_COMMENTS'] = '0';
$Configuration['PERMISSION_VIEW_HIDDEN_COMMENTS'] = '0';
$Configuration['PERMISSION_ADD_COMMENTS_TO_CLOSED_DISCUSSION'] = '0';
$Configuration['PERMISSION_ADD_CATEGORIES'] = '0';
$Configuration['PERMISSION_EDIT_CATEGORIES'] = '0';
$Configuration['PERMISSION_REMOVE_CATEGORIES'] = '0';
$Configuration['PERMISSION_SORT_CATEGORIES'] = '0';
$Configuration['PERMISSION_VIEW_ALL_WHISPERS'] = '0';
// User Moderator Permissions
$Configuration['PERMISSION_APPROVE_APPLICANTS'] = '0';
$Configuration['PERMISSION_RECEIVE_APPLICATION_NOTIFICATION'] = '0';
$Configuration['PERMISSION_CHANGE_USER_ROLE'] = '0';
$Configuration['PERMISSION_EDIT_USERS'] = '0';
$Configuration['PERMISSION_IP_ADDRESSES_VISIBLE'] = '0';
$Configuration['PERMISSION_MANAGE_REGISTRATION'] = '0';
$Configuration['PERMISSION_SORT_ROLES'] = '0';
$Configuration['PERMISSION_ADD_ROLES'] = '0';
$Configuration['PERMISSION_EDIT_ROLES'] = '0';
$Configuration['PERMISSION_REMOVE_ROLES'] = '0';
// Administrative Permissions
$Configuration['PERMISSION_CHECK_FOR_UPDATES'] = '0';
$Configuration['PERMISSION_CHANGE_APPLICATION_SETTINGS'] = '0';
$Configuration['PERMISSION_MANAGE_EXTENSIONS'] = '0';
$Configuration['PERMISSION_MANAGE_LANGUAGE'] = '0';
$Configuration['PERMISSION_MANAGE_THEMES'] = '0';
$Configuration['PERMISSION_MANAGE_STYLES'] = '0';
$Configuration['PERMISSION_ALLOW_DEBUG_INFO'] = '0';
// Default values for User Preferences
$Configuration['PREFERENCE_HtmlOn'] = '1';
$Configuration['PREFERENCE_ShowAppendices'] = '1';
$Configuration['PREFERENCE_ShowSavedSearches'] = '1';
$Configuration['PREFERENCE_ShowTextToggle'] = '1';
$Configuration['PREFERENCE_JumpToLastReadComment'] = '1';
$Configuration['PREFERENCE_ShowLargeCommentBox'] = '0';
$Configuration['PREFERENCE_ShowFormatSelector'] = '1';
$Configuration['PREFERENCE_ShowDeletedDiscussions'] = '0';
$Configuration['PREFERENCE_ShowDeletedComments'] = '0';
// Newbie settings
// Has Vanilla been installed (this will be set to true in conf/settings.php when setup completes)
$Configuration['SETUP_COMPLETE'] = '0';
$Configuration['ADDON_NOTICE'] = '1';
// Application versions
include(dirname(__FILE__) . '/version.php');
// Application Mode Constants
define('MODE_DEBUG', 'DEBUG');
define('MODE_RELEASE', 'RELEASE');
// Format type definitions
define('FORMAT_STRING_FOR_DISPLAY', 'DISPLAY');
define('FORMAT_STRING_FOR_DATABASE', 'DATABASE');
// PHP Settings
define('MAGIC_QUOTES_ON', get_magic_quotes_gpc());
// Self Url (should be hard-coded by each page - this is here just in case it was forgotten)
$Configuration['SELF_URL'] = #$_SERVER['PHP_SELF'];
// Include custom settings
include(dirname(__FILE__) . '/../conf/settings.php');
if ($Configuration['SETUP_COMPLETE'] == '0') {
header('Location: ./setup/index.php');
}
// Define a constant to prevent a register_globals attack on the configuration paths
define('IN_VANILLA', '1');
//upgrade database
if ($Configuration['DATABASE_VERSION'] < 2) {
include_once($Configuration['APPLICATION_PATH'].'appg/database.php');
include_once($Configuration['DATABASE_PATH']);
include_once($Configuration['LIBRARY_PATH'].'Framework/Framework.Functions.php');
include_once($Configuration['LIBRARY_PATH'].'Framework/Framework.Class.Database.php');
include_once($Configuration['LIBRARY_PATH'].'Framework/Framework.Class.'.$Configuration['DATABASE_SERVER'].'.php');
include_once($Configuration['LIBRARY_PATH'].'Framework/Framework.Class.SqlBuilder.php');
include_once($Configuration['LIBRARY_PATH'].'Framework/Framework.Class.MessageCollector.php');
include_once($Configuration['LIBRARY_PATH'].'Framework/Framework.Class.ErrorManager.php');
include_once($Configuration['LIBRARY_PATH'].'Framework/Framework.Class.ObjectFactory.php');
include_once($Configuration['LIBRARY_PATH'].'Framework/Framework.Class.StringManipulator.php');
include_once($Configuration['LIBRARY_PATH'].'Framework/Framework.Class.Context.php');
include_once($Configuration['LIBRARY_PATH'].'Framework/Framework.Class.Delegation.php');
include_once($Configuration['LIBRARY_PATH'].'Vanilla/Vanilla.Functions.php');
include_once($Configuration['LIBRARY_PATH'].$Configuration['AUTHENTICATION_MODULE']);
include_once($Configuration['LIBRARY_PATH'].'People/People.Class.Session.php');
include_once($Configuration['LIBRARY_PATH'].'People/People.Class.PasswordHash.php');
include_once($Configuration['LIBRARY_PATH'].'People/People.Class.User.php');
$Context = new Context($Configuration);
$Context->DatabaseTables = &$DatabaseTables;
$Context->DatabaseColumns = &$DatabaseColumns;
$Query = 'ALTER TABLE '
. GetTableName('User', $DatabaseTables, $Configuration["DATABASE_TABLE_PREFIX"])
. ' CHANGE ' . $DatabaseColumns['User']['Password'].' '
. $DatabaseColumns['User']['Password'] . ' VARBINARY( 34 ) NULL DEFAULT NULL';
if ($Context->Database->Execute($Query,'','','',0)) {
AddConfigurationSetting($Context, 'DATABASE_VERSION', '2');
}
unset($Context, $Query);
}
?>
conf/settings.php
<?php
// Application Settings
$Configuration['SETUP_TEST'] = '1';
$Configuration['APPLICATION_PATH'] = '/var/www/michebagshows.com/vanilla/';
$Configuration['DATABASE_PATH'] = '/var/www/michebagshows.com/vanilla/conf/database.php';
$Configuration['LIBRARY_PATH'] = '/var/www/michebagshows.com/vanilla/library/';
$Configuration['EXTENSIONS_PATH'] = '/var/www/michebagshows.com/vanilla/extensions/';
$Configuration['LANGUAGES_PATH'] = '/var/www/michebagshows.com/vanilla/languages/';
$Configuration['THEME_PATH'] = '/var/www/michebagshows.com/vanilla/themes/Blogger/';
$Configuration['DEFAULT_STYLE'] = '/themes/Blogger/styles/default/';
$Configuration['WEB_ROOT'] = '/';
$Configuration['BASE_URL'] = 'http://forums.michebagshows.com/';
$Configuration['FORWARD_VALIDATED_USER_URL'] = 'http://forums.michebagshows.com/';
$Configuration['SUPPORT_EMAIL'] = 'info#michebag.com';
$Configuration['SUPPORT_NAME'] = 'Miche Bag';
$Configuration['APPLICATION_TITLE'] = 'Miche Bag Distributor Forums';
$Configuration['BANNER_TITLE'] = 'Distributor Forums';
$Configuration['COOKIE_DOMAIN'] = 'forums.michebagshows.com';
$Configuration['COOKIE_PATH'] = '/';
$Configuration['SETUP_COMPLETE'] = '1';
$Configuration['DATABASE_VERSION'] = '2';
$Configuration['ADDON_NOTICE'] = '0';
$Configuration['SMTP_USER'] = 'admin';
$Configuration['SMTP_PASSWORD'] = 'm1ch3b4g';
$Configuration['DEFAULT_ROLE'] = '3';
$Configuration['ALLOW_IMMEDIATE_ACCESS'] = '1';
$Configuration['NOTIFI_ALLOW_ALL'] = '1';
$Configuration['NOTIFI_ALLOW_DISCUSSION'] = '1';
$Configuration['NOTIFI_ALLOW_CATEGORY'] = '1';
$Configuration['NOTIFI_AUTO_ALL'] = '0';
$Configuration['NOTIFI_INSTALL_V2_COMPLETE'] = '1';
$Configuration['PASSWORD_RESET_VERSION'] = '0.3';
$Configuration['LAST_UPDATE'] = '1265210955';
$Configuration['DEFAULT_PAGE_USE_RETURN'] = '';
$Configuration['DEFAULT_PAGE'] = 'categories.php';
$Configuration['PUBLIC_BROWSING'] = '0';
$Configuration['ATTACHMENTS_UPLOAD_PATH'] = '/var/www/michebagshows.com/vanilla/uploads/%year%/%month%/';
$Configuration['ATTACHMENTS_MAXIMUM_FILESIZE'] = '3512000';
$Configuration['ATTACHMENTS_VERSION'] = '2.1';
?>
#DaveRandom is right. Your config file (settings.php) has been overwritten or backed up from a state that is not configured, but it is a mystery to me how this could have happened by accident.
The proof is right here, and indicates that the forum doesn't think it has been configured yet:
$Configuration['SETUP_COMPLETE'] = '0';
Perhaps someone reinstalled the Vanilla software, or tried to perform some kind of update, and accidentally overwrote this important file.
settings.php usually contains all the site-specific configuration for your forum, such as database names and passwords, the root folders of your site's various applications, etc. This is the kind of thing that is built at setup time, when you first install your forum.
Unless you have a backup of this file, you're going to have to perform the setup again. Make sure you backup your database first.
So we found out what the problem was... It turns out our old programmer didn't transfer the rest of the files over to the right server. I wasn't even aware there was a transfer. But it's fixed now! Thank you guys for your help.