i am having trouble uploading large files with Responsive File Manager, it shows Not enough memory limit error.
i tried changing limits in php.ini
upload limit to 100MB
post max size to 100MB
script memory limit to 300MB
max execution time to 300
i also changed the limit in config.php
'MaxSizeUpload' => 100
But still the same error.
now even few 100 kb is not uploading.
what may be the problem?
Edit 1:
i use the default upload.php from responsive file manager for uploading my files
at line 157 the memory error is checked
default upload.php
my config.php
<?php
if (session_id() == '') session_start();
mb_internal_encoding('UTF-8');
mb_http_output('UTF-8');
mb_http_input('UTF-8');
mb_language('uni');
mb_regex_encoding('UTF-8');
ob_start('mb_output_handler');
date_default_timezone_set('Asia/Kolkata');
define('USE_ACCESS_KEYS', false); // TRUE or FALSE
define('DEBUG_ERROR_MESSAGE', true); // TRUE or FALSE
$config = array(
'base_url' => ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] && ! in_array(strtolower($_SERVER['HTTPS']), array( 'off', 'no' ))) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'],
'upload_dir' => '/photos/original/',
'current_path' => '../photos/original/',
'thumbs_base_path' => '../cache/',
'ftp_host' => false,
'ftp_user' => "user",
'ftp_pass' => "pass",
'ftp_base_folder' => "base_folder",
'ftp_base_url' => "http://site to ftp root",
'ftp_thumbs_dir' => '/thumbs/',
'ftp_ssl' => false,
'ftp_port' => 21,
'access_keys' => array(),
'MaxSizeTotal' => false,
'MaxSizeUpload' => 100,
'fileFolderPermission' => 0755,
'default_language' => "en_EN",
'icon_theme' => "ico",
'show_total_size' => false,
'show_folder_size' => false,
'show_sorting_bar' => true,
'show_filter_buttons' => true,
'show_language_selection' => false,
'transliteration' => false,
'convert_spaces' => false,
'replace_with' => "_",
'lower_case' => false,
'add_time_to_img' => false,
'lazy_loading_file_number_threshold' => 0,
'image_max_width' => 0,
'image_max_height' => 0,
'image_max_mode' => 'auto',
'image_resizing' => false,
'image_resizing_width' => 0,
'image_resizing_height' => 0,
'image_resizing_mode' => 'auto',
'image_resizing_override' => false,
'image_watermark' => false,
'image_watermark_position' => 'br',
'image_watermark_padding' => 0,
'default_view' => 0,
'ellipsis_title_after_first_row' => true,
'delete_files' => true,
'create_folders' => false,
'delete_folders' => false,
'upload_files' => true,
'rename_files' => true,
'rename_folders' => false,
'duplicate_files' => false,
'copy_cut_files' => true, // for copy/cut files
'copy_cut_dirs' => false, // for copy/cut directories
'chmod_files' => false, // change file permissions
'chmod_dirs' => false, // change folder permissions
'preview_text_files' => false, // eg.: txt, log etc.
'edit_text_files' => false, // eg.: txt, log etc.
'create_text_files' => false, // only create files with exts. defined in $editable_text_file_exts
'previewable_text_file_exts' => array( "bsh", "c","css", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html", "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh", "xhtml", "xml","xsl" ),
'previewable_text_file_exts_no_prettify' => array( 'txt', 'log' ),
'editable_text_file_exts' => array( 'txt', 'log', 'xml', 'html', 'css', 'htm', 'js' ),
'googledoc_enabled' => true,
'googledoc_file_exts' => array( 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx' ),
'viewerjs_enabled' => true,
'viewerjs_file_exts' => array( 'pdf', 'odt', 'odp', 'ods' ),
'copy_cut_max_size' => 100,
'copy_cut_max_count' => 200,
'ext_img' => array( 'jpg', 'jpeg', 'png', 'gif', 'bmp', 'tiff', 'svg' ), //Images
'ext_file' => array(), //Files
'ext_video' => array(), //Video
'ext_music' => array(), //Audio
'ext_misc' => array(), //Archives
'aviary_active' => false,
'aviary_apiKey' => "2444282ef4344e3dacdedc7a78f8877d",
'aviary_language' => "en",
'aviary_theme' => "light",
'aviary_tools' => "all",
'aviary_maxSize' => "1400",
'file_number_limit_js' => 500,
'hidden_folders' => array(),
'hidden_files' => array( 'config.php' ),
'url_upload' => false,
'java_upload' => false,
'JAVAMaxSizeUpload' => 200, //Gb
'fixed_image_creation' => false,
'fixed_path_from_filemanager' => array( '../images/thumbs2/', '../test1/' ),
'fixed_image_creation_name_to_prepend' => array( 'thumb_', 'test_' ),
'fixed_image_creation_to_append' => array( '', '' ),
'fixed_image_creation_width' => array( 300, 400 ),
'fixed_image_creation_height' => array( 200, '' ),
'fixed_image_creation_option' => array( 'auto', 'auto' ),
'relative_image_creation' => true,
'relative_path_from_current_pos' => array( '../hd', '../fullhd','../thumbs' ),
'relative_image_creation_name_to_prepend' => array( '', '' , ''),
'relative_image_creation_name_to_append' => array( '', '',''),
'relative_image_creation_width' => array( 1280, 1920 , 200),
'relative_image_creation_height' => array( 720, 1080, 200 ),
'relative_image_creation_option' => array( 'auto', 'auto', 'auto' ),
'remember_text_filter' => false,
);
return array_merge(
$config,
array(
'MaxSizeUpload' => ((int)(ini_get('post_max_size')) < $config['MaxSizeUpload'])
? (int)(ini_get('post_max_size')) : $config['MaxSizeUpload'],
'ext'=> array_merge(
$config['ext_img'],
$config['ext_file'],
$config['ext_misc'],
$config['ext_video'],
$config['ext_music']
),
'aviary_defaults_config' => array(
'apiKey' => $config['aviary_apiKey'],
'language' => $config['aviary_language'],
'theme' => $config['aviary_theme'],
'tools' => $config['aviary_tools'],
'maxSize' => $config['aviary_maxSize']
),
)
);
?>
error screenshot
If you are using NGINX you should check configured maximum post entity size. In my default configuration it was less than PHP post file limit.
Related
https://www.ticimax.com/dokumanlar/webservis.pdf
Ticimax is an e-commerce software in Turkey. I'm trying to create products by using their webservice for one of my clients. I've used all of their webservice methods. But i'm stuck with their product creation method "SaveUrun". Because this method has only one thing different from other methods. This method accepts a parameter as ref
SaveUrun method is in the document from page 7 to page 9.
If you look at page 9, you will see this line at the end of the method definitions:
urunServis.SaveUrun("U15saQ48dW453X1cA", ref urunKartlari, ukAyar, varyasyonAyar);
urunKartlari is passed as ref.
What is ref? What is it stands for? What is the equivalent of it in PHP? How can i make my code work? Can you please help me?
This is what i get when i make the SOAP call:
Value cannot be null. Parameter name: source
Here is my example code:
<?php
$ticimax = new SoapClient("http://www.CLIENTDOMAIN.com/Servis/UrunServis.svc?wsdl");
$kategoriler = array();
$urunResimleri = array();
$varyasyonlar = array(
array(
"ID" => 0,
"Aktif" => false,
"AlisFiyati" => 10,
"Barkod" => "",
"Desi" => 1,
"KargoUcreti" => 0,
"KdvDahil" => true,
"KdvOrani" => 8,
"Ozellikler" => array(
array(
"Tanim" => "Numara",
"Deger" => 38
),
array(
"Tanim" => "Renk",
"Deger" => "Mavi"
)
),
"ParaBirimiID" => 1,
"Resimler" => array(),
"SatisFiyati" => 100,
"StokAdedi" => 15,
"StokKodu" => ""
),
array(
"ID" => 0,
"Aktif" => false,
"AlisFiyati" => 10,
"Barkod" => "",
"Desi" => 1,
"KargoUcreti" => 0,
"KdvDahil" => true,
"KdvOrani" => 8,
"Ozellikler" => array(
array(
"Tanim" => "Numara",
"Deger" => 40
),
array(
"Tanim" => "Renk",
"Deger" => "Mavi"
)
),
"ParaBirimiID" => 1,
"Resimler" => array(),
"SatisFiyati" => 100,
"StokAdedi" => 15,
"StokKodu" => ""
)
);
$urunKarti = array(
"ID" => 0,
"Aktif" => false,
"UrunAdi" => "Test ürün adı",
"Aciklama" => "Test ürün açıklama",
"AnaKategori" => "İç Giyim",
"AnaKategoriID" => 1,
"Kategoriler" => $kategoriler,
"MarkaID" => 1,
"TedarikciID" => 1,
"Resimler" => $urunResimleri,
"SatisBirimi" => "Adet",
"UcretsizKargo" => false,
"OnYazi" => "Test ürün önyazı",
"PuanDeger" => 12,
"SeoAnahtarKelime" => "",
"SeoSayfaAciklama" => "",
"SeoSayfaBaslik" => "",
"Varyasyonlar" => $varyasyonlar,
"Vitrin" => false,
"YeniUrun" => false
);
$params = array(
array(
"UyeKodu" => WEBSERVICE_PASSWORD,
"UrunKartlari" => $urunKarti,
"ukAyar" => array(
"AciklamaGuncelle" => true,
"AktifGuncelle" => true,
"FBStoreGosterGuncelle" => false,
"FirsatUrunuGuncelle" => true,
"KategoriGuncelle" => false,
"MaksTaksitSayisiGuncelle" => false,
"MarkaGuncelle" => false,
"OnYaziGuncelle" => false,
"ParaPuanGuncelle" => true,
"SatisBirimiGuncelle" => false,
"SeoAnahtarKelimeGuncelle" => false,
"SeoSayfaAciklamaGuncelle" => false,
"SeoSayfaBaslikGuncelle" => false,
"TedarikciGuncelle" => false,
"UcretsizKargoGuncelle" => true,
"UrunAdiGuncelle" => true,
"UrunResimGuncelle" => false,
"VitrinGuncelle" => false,
"YeniUrunGuncelle" => true
),
"vAyar" => array(
"AktifGuncelle" => false,
"AlisFiyatiGuncelle" => true,
"BarkodGuncelle" => false,
"IndirimliFiyatiGuncelle" => true,
"KargoUcretiGuncelle" => false,
"KargoAgirligiGuncelle" => true,
"ParaBirimiGuncelle" => false,
"PiyasaFiyatiGuncelle" => true,
"SatisFiyatiGuncelle" => false,
"StokAdediGuncelle" => true,
"UyeTipiFiyat1Guncelle" => false,
"UyeTipiFiyat2Guncelle" => true,
"UyeTipiFiyat3Guncelle" => false,
"UyeTipiFiyat4Guncelle" => true,
"UyeTipiFiyat5Guncelle" => false,
"TedarikciKodunaGoreGuncelle" => false
)
)
);
try{
print_r($ticimax->__soapCall("SaveUrun", $params));
}
catch(Exception $e){
echo $e->getMessage();
}
?>
Can you please fix my code?
UyeKodu UrunKartlari fields in Params array must be uyeKodu urunKartlari
I'm working today on an Wordpress plugin with the beautiful WP_Editor()
But this editor doesn't format their HTML, every time i add some html text with the editor and save it correctly as an posts in the database, is everything fine. but when i post this html string data to my WP_Editor() it messed it up.
Is their an solution to get the right format to view html in the wp_editor?
thanks a lot!
P.s. my code:
$settings_desc = array(
'textarea_name' => 'description',
'mode' => 'specific_textareas',
'editor_selector' => 'theEditor',
'width' => '100%',
'theme' => 'advanced',
'skin' => 'wp_theme',
'theme_advanced_buttons1' => 'bold,italic,strikethrough,|,bullist,numlist,blockquote,|,justifyleft,justifycenter,justifyright,|,link,unlink,wp_more,|,spellchecker,fullscreen,wp_adv',
'theme_advanced_buttons2' => 'formatselect,underline,justifyfull,forecolor,|,pastetext,pasteword,removeformat,|,media,charmap,|,outdent,indent,|,undo,redo,wp_help',
'theme_advanced_buttons3' => '',
'theme_advanced_buttons4' => '',
'language' => 'de',
'spellchecker_languages' => 'English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,+German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv',
'theme_advanced_toolbar_location' => 'top',
'theme_advanced_toolbar_align' => 'left',
'theme_advanced_statusbar_location' => 'bottom',
'theme_advanced_resizing' => true,
'theme_advanced_resize_horizontal' => false,
'dialog_type' => 'modal',
'relative_urls' => false,
'remove_script_host' => false,
'convert_urls' => false,
'apply_source_formatting' => false,
'remove_linebreaks' => true,
'gecko_spellcheck' => true,
'entities' => '38,amp,60,lt,62,gt',
'accessibility_focus' => true,
'tabfocus_elements' => 'major-publishing-actions',
'media_strict' => false,
'paste_remove_styles' => true,
'paste_remove_spans' => true,
'paste_strip_class_attributes' => 'all',
'wpeditimage_disable_captions' => false,
'plugins' => 'safari,inlinepopups,spellchecker,paste,wordpress,media,fullscreen,wpeditimage,wpgallery,tabfocus',
);
I'm using stwe/datataTablebundle for my symfony application. I'd like to have individual column filters on some specific columns, but setting 'individual_filterting' => true turns on the filter for every column. How to I specify columns? Currently I am hiding unwanted columns using css.
$this->options->set(array(
'display_start' => 0,
'defer_loading' => -1,
'dom' => 'lfiprtip',
'length_menu' => array(20, 50, 100, 1000, 10000, '"All"'),
'order_classes' => true,
'order' => array(array(0, 'asc')),
'order_multi' => true,
'page_length' => 50,
'paging_type' => Style::FULL_NUMBERS_PAGINATION,
'renderer' => '',
'scroll_collapse' => false,
'search_delay' => 0,
'state_duration' => 7200,
'stripe_classes' => array(),
'class' => Style::BOOTSTRAP_3_STYLE . ' table-condensed',
'individual_filtering' =>false,
'individual_filtering_position' => 'head',
'use_integration_options' => true,
'force_dom' => true,
));
I have an array of behaviour $actas.Problem is when I adding date() function on the array string,it's return an error:
Example:
public $actas = array(
'Uploader.Attachment'=>array(
'books' => array(
'maxWidth' => 1200,
'maxHeight' => 1200,
'extension' => array('pdf'),
'nameCallback' => '',
'append' => '',
'prepend' => '',
'tempDir' => TMP,
'uploadDir' => '/var/www/html/apps/webroot/files/uploads/books' . date('d-m-Y'),//this is where I want to add the function.
'transportDir' => ''
)
)
);
however it's not working. I also do like this:
public $actas = array(
'Uploader.Attachment'=>array(
'books' => array(
'maxWidth' => 1200,
'maxHeight' => 1200,
'extension' => array('pdf'),
'nameCallback' => '',
'append' => '',
'prepend' => '',
'tempDir' => TMP,
'uploadDir' => "/var/www/html/apps/webroot/files/uploads/books'".date('d-m-Y')."'",//this is where I want to add the function.
'transportDir' => ''
)
)
);
also not worked.
So my question is how to do that? If I have a lot of mistaken,please tell me so I can learn more about the matter.
Thanks in advance.
This is the full source code of Post.php model
<?php
App::uses('AppModel', 'Model');
/**
* Post Model
*
* #property Tier $Tier
* #property Category $Category
* #property Comment $Comment
*/
class Post extends AppModel {
//var $now = 'CURDATE()';
/**
* Validation rules
*
* #var array
*/
public $validate = array(
'title' => array(
'notEmpty' => array(
'rule' => array('notEmpty'),
//'message' => 'Your custom message here',
//'allowEmpty' => false,
//'required' => false,
//'last' => false, // Stop validation after this rule
//'on' => 'create', // Limit validation to 'create' or 'update' operations
),
),
'content' => array(
'notEmpty' => array(
'rule' => array('notEmpty'),
//'message' => 'Your custom message here',
//'allowEmpty' => false,
//'required' => false,
//'last' => false, // Stop validation after this rule
//'on' => 'create', // Limit validation to 'create' or 'update' operations
),
),
);
//The Associations below have been created with all possible keys, those that are not needed can be removed
/**
* belongsTo associations
*
* #var array
*/
public $belongsTo = array(
'Tier' => array(
'className' => 'Tier',
'foreignKey' => 'tier_id',
'conditions' => '',
'fields' => '',
'order' => ''
),
'Category' => array(
'className' => 'Category',
'foreignKey' => 'category_id',
'conditions' => '',
'fields' => '',
'order' => ''
)
);
/**
* hasMany associations
*
* #var array
*/
public $hasMany = array(
'Comment' => array(
'className' => 'Comment',
'foreignKey' => 'post_id',
'dependent' => false,
'conditions' => '',
'fields' => '',
'order' => '',
'limit' => '',
'offset' => '',
'exclusive' => '',
'finderQuery' => '',
'counterQuery' => ''
)
);
public $actsAs = array(
//'Containable',
'Uploader.Attachment' => array(
// Do not copy all these settings, it's merely an example
'banner' => array(
'maxWidth' => 1200,
'maxHeight' => 1200,
'extension' => array('gif', 'jpg', 'png', 'jpeg'),
'nameCallback' => '',
'append' => '',
'prepend' => '',
'tempDir' => TMP,
'uploadDir' => "/var/www/html/apps/webroot/img/banners/",
'transportDir' => '',
'finalPath' => '/img/banners/',
'dbColumn' => '',
'metaColumns' => array(),
'defaultPath' => '',
'overwrite' => true,
'transforms' => array(),
'stopSave' => true,
'allowEmpty' => true,
'transformers' => array(),
'transport' => array(),
'transporters' => array(),
'curl' => array()
),
'feature' => array(
'maxWidth' => 1200,
'maxHeight' => 1200,
'extension' => array('gif', 'jpg', 'png', 'jpeg'),
'nameCallback' => '',
'append' => '',
'prepend' => '',
'tempDir' => TMP,
'uploadDir' => '/var/www/html/apps/webroot/img/features/',
'transportDir' => '',
'finalPath' => '/img/features/',
'dbColumn' => '',
'metaColumns' => array(),
'defaultPath' => '',
'overwrite' => true,
'transforms' => array(),
'stopSave' => true,
'allowEmpty' => true,
'transformers' => array(),
'transport' => array(),
'transporters' => array(),
'curl' => array()
),
'books' => array(
'maxWidth' => 1200,
'maxHeight' => 1200,
'extension' => array('pdf'),
'nameCallback' => '',
'append' => '',
'prepend' => '',
'tempDir' => TMP,
'uploadDir' => '/var/www/html/apps/webroot/files/uploads/books' . date('d-m-Y'),
'transportDir' => '',
'finalPath' => '/files/uploads/books/',
'dbColumn' => '',
'metaColumns' => array(),
'defaultPath' => '',
'overwrite' => true,
'transforms' => array(),
'stopSave' => true,
'allowEmpty' => true,
'transformers' => array(),
'transport' => array(),
'transporters' => array(),
'curl' => array()
)
)
);
}
ahh ok I was not looking at it with my OO hat on. you can't do this because:
Properties
Class member variables are called "properties". You may also see them
referred to using other terms such as "attributes" or "fields", but
for the purposes of this reference we will use "properties". They are
defined by using one of the keywords public, protected, or private,
followed by a normal variable declaration. This declaration may
include an initialization, but this initialization must be a
constant value--that is, it must be able to be evaluated at compile
time and must not depend on run-time information in order to be
evaluated.
you need to use the __construct() method
I have a variable $code which contains the following data. I want the contents of $feeds_importer to an array. How can I do this?
$feeds_importer = new stdClass;
$feeds_importer->disabled = FALSE;
/* Edit this to true to make a default feeds_importer disabled initially */
$feeds_importer->api_version = 1;
$feeds_importer->id = 'feed';
$feeds_importer->config = array(
'name' => 'Feed',
'description' => 'Import RSS or Atom feeds, create nodes from feed items.',
'fetcher' => array(
'plugin_key' => 'FeedsHTTPFetcher',
'config' => array(
'auto_detect_feeds' => FALSE,
'use_pubsubhubbub' => FALSE,
'designated_hub' => '',
),
),
'parser' => array(
'plugin_key' => 'FeedsSyndicationParser',
'config' => array(),
),
'processor' => array(
'plugin_key' => 'FeedsNodeProcessor',
'config' => array(
'content_type' => 'feed_item',
'update_existing' => 0,
'expire' => '-1',
'mappings' => array(
array(
'source' => 'title',
'target' => 'title',
'unique' => FALSE,
),
array(
'source' => 'description',
'target' => 'body',
'unique' => FALSE,
),
array(
'source' => 'timestamp',
'target' => 'created',
'unique' => FALSE,
),
array(
'source' => 'url',
'target' => 'url',
'unique' => TRUE,
),
array(
'source' => 'guid',
'target' => 'guid',
'unique' => TRUE,
),
),
'input_format' => 0,
'author' => 0,
),
),
'content_type' => 'feed',
'update' => 0,
'import_period' => '1800',
'expire_period' => 3600,
'import_on_create' => 1,
);
i want the contents of feeds_importer to an array how can i do this?
$array = (array) $feeds_importer;