Wordpress, Add Media issue after Theme changed - php

i am new to Wordpress and PHP.
I have an issue with adding images to posts and pages. I can directly upload images to the Media Library (Dashboard/Media). I think the problem might be my custom theme. When i switch to a different theme the problem goes away.
When i try to add an image to the page it shows this error message: An error occurred in the upload. Please try again later.
Also, its not loading the existing images either.
I don't have any plugins installed.
Uploads folder reading and writing permissions is correct.
Any advice or tips that might help, would be appreciated.
A suggestion on how to debug it, would also help. I tried to use chrome developers tool bar, console but didn't find anything.
Media Library (Dashboard/Media) upload images is working fine.
Could it be an url issue?
If so where and how can i check my url setting for uploads folder
Thanks in advance.

Check the size of the file, edit your .htaccess
<IfModule mod_php5.c>
php_value post_max_size 200M
php_value upload_max_filesize 200M
php_value memory_limit 300M
php_value max_execution_time 259200
php_value max_input_time 259200
php_value session.gc_maxlifetime 1200
</IfModule>
or edit your file php.ini
max_execution_time = 180
max_input_time = 600
post_max_size = 128M
upload_max_filesize = 256M
safe_mode = off
PD : Change and test different values
Edit File on Godaddy : https://www.drupal.org/node/1209090 + https://stackoverflow.com/questions/21926795/how-to-create-php-ini-file-in-godaddy

Solved the problem. Just in case someone else have the same problem. We had written comments in the HTML sections of the page. Even thought the comments was comment out, it seemed to cause the problem. Hope this will help someone else

Related

Aw snap error on large file uploads

I have file uploads on my site, these work fine, but for some reason larger files ( anything over 1GB really ) in chrome gives Aw Snap error, this does not happen in any other browser.
Ive tried looking into it and cant find any information as to a work around on this error. Does anyone know how I can overcome this issue?
Is this something I can sort out on my server to stop the error, the only thing ive been able to find is re-fresh your browser to fix the issue.
Thanks for any support
update your google-chrome browser..
and increase these values in php.ini file
upload_max_filesize = 200M
post_max_size = 210M
max_execution_time = 500
max_input_time = 500
default_socket_timeout = 500
and if you can't access the php.ini file, you can edit these values using .htaccess file, by
php_value session.gc_maxlifetime 10800
php_value max_input_time 10800
php_value max_execution_time 10800
php_value upload_max_filesize 200M
php_value post_max_size 210M
php_value memory_limit 500M
and give it a try.. it worked for me
I know it's too late answer, but hope it could help you if you still have the same issue, or it could anyone facing the same problem

Maximum upload file size not reflecting to phpinfo()

My problem is that when I check to wp-admin/media-new.php I see Maximum upload file size: 8 MB. Now I change the php.ini located at /usr/lib/php.ini I change the upload_max_filesize to 64M and post_max_size 64M. Then when I checked back to wp-admin/media-new.php it is now 'Maximum upload file size: 15M' it should be 64M
I even try following this http://www.wpbeginner.com/wp-tutorials/how-to-increase-the-maximum-file-upload-size-in-wordpress/ but it doesn't help it. it looks like it is limited to 15M? I try to change the post_max_size to 14M then it reads now on wp-admin/media-new.php to 'Maximum upload file size: 14M' it looks like it only limits to 15M. I restarted the apache but still it won't work and it only shows 15M
I checked the phpinfo() and the file loaded is correct which is /usr/lib/php.ini
Is there any settings in wordpress that is limiting the upload file size except on the network setting? no right? What could be the problem?
I Fixed my issues. Here are what I've learned:
1) Make sure there are no conflict with your php.ini.. I checked my phpinfo() and the file loaded is /usr/local/lib/php.ini however there is php.ini placed in the wp-admin/ folder so I deleted it and this cause overriding the setting.
2) If you are running multisite make sure that 'Max upload file size' option in wp-admin/network/settings.php is correct based on your desire cause this will reflect in the main site.
You can use this cod ein .htaccess file.
<IfModule mod_php5.c>
php_value post_max_size 128M
php_value upload_max_filesize 128M
php_value memory_limit 500M
</IfModule>
Change file size as your requirement.
I hope this will work for you.

Wordpress error, "Are you sure you want to do this? Try again"

I hope you can help me, I am using a server running Parallels Plesk and installed WordPress as well. When I try to install a new theme, I am getting the following after 100% of uploading the theme:
Are you sure you want to do this? Try again
I have been seeking for a solution for hours now and facing all question raising the question on a forum.
So you see answers like the .ini file needs to be edited, but where .ini file and by the answer you see that the .ini file getting edited with Unix commands.
As well you read that changing these setting might help.
max_execution_time 100
memory_limit 256M
post_max_size 32M
upload_max_filesize 32M
How do I change these setting with Plesk or is there somewhere a description where this been described step by step about how and where to change the setting in the PHP files?
Can you please navigate me to the solution to be able to upload themes?
You will have to update the following setting in php.ini file. You can change it through plesk domain panel >> hosting setting and change it under the php setting.
max_execution_time = 180
max_input_time = 600
post_max_size = 128M
upload_max_filesize = 256M

File upload not working on server in php

I am facing a problem while uploading a file/ image in PHP. When I uplopad an 8kb file it works fine but when I upload more that 50kb file it keeps on loading and do nothing, I have checked upto 5 mins. The path to phpinfo() on my server is http://kogd.tw/jatin.php
I have tried to set following variables in my .htacess file but nothing worked.
php_value file_uploads On
php_value memory_limit 1024M
php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300
php_value max_input_time 300
Can anyone please help me regarding it.
To know the problem more, please try to upload a file on link http://kogd.tw/jatin_upload.php
You can try to cahnge de default values with ini_set
ini_set("upload_max_filesize","60M");
ini_set("post_max_size","64M");
change the MB whatever you want to.

Increasing Upload_Max_Filesize limit

I am facing a little problem with increasing the Upload_Max_Filesize limit on a clients server. The Upload_Max_Filesize is set to 2M and I need to increase it to at least 10M. There's no php.ini file currently present inside any of the folders albeit I tried creating a php.ini file and then uploaded it to the root folder of the website but that didn't work. I also edited the .htaccess file by putting these two lines inside it but, sadly, that didn't work either:
php_value upload_max_filesize 10M
php_value post_max_size 10M
I have access to the cPanel but it's mentioned inside the PHP Configuration page that:
These PHP configuration settings are customizable by the server administrator. They are listed for reference only.
Please let me know if there's any other way through which I can increase the limit of Upload_Max_Filesize.
You have to contact your host to increase your upload size. I've successfully done it from 5mb to 20mb. You just need to ask.

Categories