Drupal 8 Webform File upload - webforms

I have a simple form with just a field to upload a file on a Drupal 8 site using the Webform module 6.0.1. If I test the form using webforms test tool, the file gets uploaded fine, it displays the loading icon for couple seconds and its ready to upload, but if I try the same in a page with the form embedded as a block, I can not upload the file it will always show me the following message if I try to submit the form, no matter how long I wait.
"File upload in progress. Uploaded file may be lost. Do you want to
continue?"
Just for testing, I increased the max upload file to 2GB and the file I'm uploading is just 5kb.
All the .js libraries I can think of are on my template.info.yml file. (core/drupal, core/jquery, core/drupal.ajax)
The private folder has been set up in my settings.php and has the permissions set correctly the .htaccess file is also set as recommended for Drupal.
I have try to upload the files in the public folder just as desperation but I get the same error
Any help will be appreciate.

I know this is more than a year old but JIC anyone else had this problem:
There are four files where you might have to make changes to raise the memory limit on uploads. The first are two separate php.ini files. One is your server's php.ini and the other is the Drupal installation's php.ini in the Drupal root folder. The server's php.ini will apply the settings to all Drupal installs (and anything using PHP) on the server, while the Drupal root php.ini file will only apply to that Drupal installation. Make changes in the php.ini file(s) under memory_limit, upload_max_filesize, post_max_size. You can often edit the server's php.ini file through cPanel's MultiPHP INI Editor.
The next file is the .htacess file where you would change the value under php_value memory_limit. Changing this only affects the Drupal install the .htaccess file belongs to. This file can be found in the Drupal root directory but is sometimes hard to find because it is a hidden file. The FTP client Forklift has the option to show hidden files under View > Show View Options > Show Hidden Files. Your FTP client of choice may also have an option to show hidden files.
The last file is the settings.php file (sites/default/settings.php) and the value to change can be found under ini_set('memory_limit', ''). For example: ini_set('memory_limit', '64M'); Again, this only affects the Drupal install the settings.php file belongs to.
memory_limit This sets the maximum amount of memory in bytes that a script is allowed to allocate. This helps prevent poorly written scripts for eating up all available memory on a server. Note that to have no memory limit, set this directive to -1.
post_max_size Sets max size of post data allowed. This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize. Generally speaking, memory_limit should be larger than post_max_size.
upload_max_filesize The maximum size of an uploaded file.

Related

Joomla cache make website's first page really late to open

I have an e-shop made with Joomla - Virtuemart.
The issue is that, at the first page, the website starts to open after 20-30seconds you hit the URL.
After discussing it with my hosting provider, they found that index.php sends for about 20s requests at the file :
httpdocs/cache/convertECB/86b44edeb1436781d050e4862dd10353-cache-convertECB-bf2c8f06ab151915cd5d7bbef20b70dd.php
Even if i manually delete it, joomla recreates the file and continue to be slow.
In global configuration cache is off.
Any idea, from what is this file coming from and how should i handle the situation?
UPDATE - CONTENT OF THE PHP FILE
<?php die("Access Denied");?>
#x#a:2:{s:6:"output";s:0:"";s:6:"result";a:32:{s:3:"EUR";s:1:"1";s:3:"USD";s:6:"1.1174";s:3:"JPY";s:6:"116.65";s:3:"BGN";s:6:"1.9558";s:3:"CZK";s:6:"27.067";s:3:"DKK";s:6:"7.4355";s:3:"GBP";s:7:"0.79033";s:3:"HUF";s:6:"315.15";s:3:"PLN";s:6:"4.4490";s:3:"RON";s:6:"4.5390";s:3:"SEK";s:6:"9.3915";s:3:"CHF";s:6:"1.0812";s:3:"NOK";s:6:"9.3798";s:3:"HRK";s:6:"7.5240";s:3:"RUB";s:7:"73.5915";s:3:"TRY";s:6:"3.2804";s:3:"AUD";s:6:"1.5212";s:3:"BRL";s:6:"3.8943";s:3:"CAD";s:6:"1.4530";s:3:"CNY";s:6:"7.3593";s:3:"HKD";s:6:"8.6715";s:3:"IDR";s:8:"14970.82";s:3:"ILS";s:6:"4.3228";s:3:"INR";s:7:"75.2010";s:3:"KRW";s:7:"1315.79";s:3:"MXN";s:7:"21.1845";s:3:"MYR";s:6:"4.5885";s:3:"NZD";s:6:"1.5899";s:3:"PHP";s:6:"51.899";s:3:"SGD";s:6:"1.5116";s:3:"THB";s:6:"39.455";s:3:"ZAR";s:7:"17.2240";}}
ECB is virtuemart currency conversion rates file. That file is downloaded 3 to 4 times daily depending on your settings. It is in cache ditetory and updated with new file names.
EDIT
You have to uninstall the module as by disabling it will still download xml conversion file. Login to administrator and then go to Control panel, Extensions - Install/Uninstall. Search and select "mod_virtuemart_currencies" now click on the uninstall button at the top.
It seems that you have more than one currency (maybe you have one product priced with another currency - once this is the case, the ECB will automatically be triggered). In any case, the fact that it's waiting 20-30 seconds means that it's timing out on something. Maybe it's trying to open a URL that has the IP of your website banned (this is very possible, and we had the exact scenario with one of our clients before).
If you can provide us with the contents of the cache file that is being called by your index.php file, maybe we can be of more help.

Codeigniter based website on Mochahost displaying blank pages

Hi i'm a bit new at uploading a website to a webserver and i've encountered a problem.
my site is using codeigniter and my host is MochaHost.
First of all I already successfully uploaded the site i made it run twice,
but on my last upload of updated files the power went out and the upload stopped half-way through. And when the power was back I reuploaded the updated files.
Now, the problem is that when ever i try to open my site it only displays a blank page. I've tried to view specific page but it still displays a blank page. Here's the site: http://www.sph-mis.com/ .. displaying only blank pages
I read somewhere that the problem might be the directory in were i put the files, and i put it on the public_html directory
http://imgur.com/EDM6Nka
The 1st and 2nd try i did worked with the same directory but now its doesnt work.
now it just displayig blank sapce;
Can anyone help me with this?
FIXED
check the reply i made below
So really the question is how to I debug a blank page in CodeIgniter. I don't know if there are some php errors waiting to be found behind that white screen of death but its your first step to figuring it out. So here goes some ways to get some errors you can actually work with.
in your .htaccess file where index.php is located put this into it: (if none exists create it)
# display php errors
php_flag display_startup_errors on
php_flag display_errors on
php_flag html_errors on
if you get a 500 error your host may be using suPHP and you cant do it this way.
another thing to do is try this
for ci older then 2.x modify the error_reporting function in index.php to use E_ALL
error_reporting(E_ALL);
for ci newer then 2.x instead set ENVIRONMENT in index.php as:
define('ENVIRONMENT', 'development');
this sets the error_reporting to E_ALL.
You can also set in application/config/config.php
$config['log_threshold'] = 4;//or 1 for error messages only
then check for a log file in the application/logs/ directory (make sure its writable)
Also make sure your db settings are correct. CI may suppress a database connection error.
Lets see if that gets you any further.
I already fixed it, what i did was got a clean copy of codeigniter and replace the application folder and added my assets folder to it and then uploaded it.. and it worked. Something must have been wrong within my old system folder.

Hosted a Drupal 7 site, but not able to clear cache, run cron

I hosted my very first site a drupal 7 site(mysite.com) and what I did is-
Copied local drupal code-set of my local site(mysite_beta.com)to the server and imported the my local DB.
Now I am not able to run cron(admin>>config>>cron) also not able to clear cache(admin>>config>>performance). It is giving me blank page whenever I push these buttons also I have checked that all my local PHP extensions are enabled on server as well.
If all PHP extensions are correct, most likely it is a memory problem. There are a number of ways you can increase the memory limit PHP can reach, the method to use, depends on the host provide and the freedom it gives you.
You can try one of these (I'd start with number 2):
Using the Drupal Tweaks module: http://drupal.org/project/drupal_tweaks
Modifying the php.ini, provided you have the access.
Locate the php.ini file you are currently using, you can use the phpinfo() function to find it.
Change the memory_limit parameter in the php.ini file. Something like:
memory_limit = 128M ;
Restart Apache. Many hosts take care of this, and all you have to do is save the file.
.htaccess
Look for the .htaccess file in the Drupal root directory, then, go to section that reads:
Override PHP settings. More in sites/default/settings.php
but the following cannot be changed at runtime.
right after these lines, add the following line:
php_value memory_limit 128M
4. settings.php
Edit sites/default/settings.php. This will only affect the site using this file.
Search for the PHP settings section, add the following line at the end of that section:
ini_set('memory_limit', '128M');
I hope you can use one of these methods.
Regards.

Payment methods in admin panel not showing Paypal methods list in 1.7.0.2

When I click on "Payment Methods" tab .i.e. System -> Configuration -> Payment Methods (from left tab under sales), It load the page as seen in the image and shows loading status forever.
I did notice one more thing, that only on this page, footer also don't show up. I tried by disabling all extensions from app/etc/modules folder but no luck.
I turn ON the path hints for admin and compared files with the my local running magento but these were identical.
Are you having any other problems in the admin panel? I had some problems displaying contents on certain pages due to the memory limit for php being set too low. You may want to try increasing it in your php.ini.
You may want to set developer mode to true in .htaccess and uncomment the php debugging line in index.php to get more info on your problem.
htaccess add the following:
SetEnv MAGE_IS_DEVELOPER_MODE "true"
index.php uncomment the following (line 77?):
#ini_set('display_errors', 1);
EDIT:Without permission to change .htaccess, refer to the line above at around 74 that says
Mage::setIsDeveloperMode(true);
You can add this just below the uncommented line to activate developer mode regardless of the environment variable being set.
If your memory is too low you'll probably see an error message indicating that situation when you go back to the page.
If your server config supports it, you can adjust the memory limit in the htaccess file. I use these values personally.
php_value memory_limit 256M
php_value max_execution_time 18000
Good luck.
As half the page content is displayed to trouble shoot do the following:
1) check what all admin permissions given if all is ok here then.
Magento logs few things for developers( Your log should be set to on)
1. Go to var/log folder and check if there is any exception log or system log generated.
2. Also in var/reports folder check it any report there.
If in Magento log nothing is found then check site level error log.
If this too is ok then you need to check things at code level or check for .xml file in app/etc/ folder path
After digging every which way to rectify this issue, I did find at least a work-around. I stripped the app/core/Paypal/etc/system.xml of everything inside the tag.
Is it recommended? No. Will it get you out of your jam if you don't need PayPal? Yes.
As far as the issue itself, memory limit is at 512, timeout is over 1,000. Still get the error (or lack there of). Page loads just timeout at seemingly random amounts of the page. Only seems to happen on this page. Can't explain it, but have run out of time to debug it.

Blank index.html in CMS softwares instead of .htaccess

I noticed Joomla, Wordpress and other CMSs have blank index.html files in ALL their sub folders to prevent people from peeking into the folder structure. My question is why can't they forbid folder viewing using the .htaccess file instead of putting a blank index.html file into all the folders. What's the difference and why have they chosen index.html?
Turning off folder 'Indexes' is best done in the master httpd.conf or vhosts.conf file rather than local .htaccess files.
Joomla (and Mambo before it) have been around quite a while and are used widely on shared hosting servers. The decision was taken to use index.html files as a safe fallback given the 'mixed' nature of shared hosting. Obviously .htaccess files are apache only, can cause server 500 errors if present on servers not expecting them or if they contain directives not supported by certain server setups. Consequently by default Joomla doesn't ship with a .htaccess file as such. There is a htaccess.txt file which the user needs to put in place manually if they activate certain features. It is assumed that a user knowledgeable enough to put the file in place will understand the consequences and if it does kill their site they will immediately understand the cause - due to the error immediately following their actions.
As server setups have advanced there is (sometimes heated) discussion about the current validity of the use of index.html files - but for now the policy is that all add-ons should ship with 'blank' index.html files in all folders.

Resources