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

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.

Related

Drupal 8 Webform File upload

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.

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.

Magento Use Web Server Rewrites in Multi Domain Setup

I have to two stores each having different domain. They are hosted on dedicated server with SuExec disabled. I have copied the .htaccess and index.php and everything works fine.
The problem I am having is with my 2nd store Web Server Rewrites. As soon I enabled this for the 2nd store which is using symbolic link to the root directory, it starts giving page not found error.
domain2.com/index.php/abc.html ----- Works Fine with Use Web Server Rewrites Turned Off
domain2.com/abc.html ----- Does not work with Use Web Server Rewrites Turned ON
The base store works without any problem.
Any help is much appreciated.
Farrukh Khan
-> Flush The Magento Cache
Goto System->Cache Management
Refresh the catalog rewrites
Goto All Cache and change drop down to Refresh.
Click save
On most server, this should take out the index.php in your URL’s.
If you are getting a 404 error, continue reading.
-> Fixed Mode_Rewrite Errors
Please check you webserver configuration.
Do you use Apache? Maybe there is something like "AllowOverride none" in your configuration which disables .htaccess-files (the .htaccess-file in your magento-root-directory defines the rewrite-rules).
The most common cause for this is that you have an incorrect .htaccess file in your ftp.
Goto the magentocommerce.com site and download the magento files again.
Extract the files, and ONLY upload the .htaccess file to your Magento root directory.
This should fix any problems related to enabling the use of web server rewrites in Magento.
I was facing the same problem above, but now i solved already. The main reason for that problem is .htaccess file. By replacing .htaccess file with magento default .htaccess file solve all the problem. Web Server Rewrites Turned on or off, you can do as you like.
After saving the configuration, don't forget to clear cache.

Moved Joomla 1.7 Site to New Server. Admin works fine. No pages display

I've just moved a Joomla 1.7 site to a new server.
Administration back-end works fine. Configuration.php seems fine. Get "The requested document was not found on this server." for every page other than Home.
Must be talking to the database OK or I'd get an error. Could this be a problem with the PHP?
Thanks,
Andy
Did you clear joomla cache ?
Disable page and/or module caching.
Disable any plugin that optimizes "loading speed".
Try removing SEF URLs (Joomla! and any 3rd party extension).
If you are using a custom .htacess, then use an unmodified joomla one.
Disable some system plugins.
Disable modules in the homepage.
Have you tried using another template (site) ?
You have Seach Engine Friendly URLs enabled in /administrator/ area's global configuration settings. You have probably enabled the option to use the mod_rewrite function which removes the /index.php/ portion of the urls.
It is a requirement of this mode that you have the .htaccess file in place in the root of your site. You probably had this correctly configured on your development server but perhaps forgot to move the file across when you went live. Some FTP programs hide dot files (files starting with a leading dot in the filename) so depending upon how you transferred the files (I'm guessing manually with FTP rather than Akeeba backup or similar) the file may have been missed. Look through your FTP client's options/preferences for an option to show/hide hidden files.
Failing this - the file could be correctly in place - but if you were developing in a sub-folder on your development server you would have set the RewriteBase line to your /sub-folder/
RewriteBase /sub-folder/
Now you've moved to the live server this line could be incorrect. If this is the case, edit the file to Read
RewriteBase /
Chances are it is one or other of these issues - missing .htaccess file or incorrect RewriteBase. A third and nowadays somewhat more unlikely option is that your server doesn't have mod_rewrite enabled - but I think that would result in server 500 errors.
Check whether you are using any modules that is calling database and you have not changed DB details in that module after migration. If admin panel is working fine then I think problem with some modules that are used in front-end. You can do debugging by disabling few suspected modules and check whether your site works fine or not. Else provide some more information about your site so that I can check further.

Product images not showing after migration of magento website

I recently migrated my magento website to a different server, and here's the process I used:
made a dump of the database.
copied all the system files from the FTP to my hard drive.
emptied the VAR folder
emptied the media cache folders
replaced the strings in the SQL dump from http://www.oldsite.com to http://www.newsite.com
restored the database on the new server
modified the local.xml file to suit the new database host, login and password.
uploaded the system files to the new server
Everything seems to work fine, except for the fact that the product images are not being displayed on the frontend for some reason.
For example, here's a path from an image that was supposed to be showing, which I got through firebug:
http://www.newsite.com/media/catalog/product/cache/1/small_image/113x113/9df78eab33525d08d6e5fb8d27136e95/1/_/1_9.jpg
When I search for the path of the image the site is supposed to show in the FTP, the file is actually there. I can download it and display it on my computer. I don't know why this is happening. It doesn't make any sense to me.
This /media/catalog/product/cache/ was generated by the system, because I erased it myself before uploading the site, so I guess it isn't a cache related issue.
Well, I described the issue the best I could. I hope you can help me out.
EDIT:
Hmm, it turns out the problem was the .htaccess file inside the media folder! Removed the file -> Problem solved!
Just in case anyone else has the same problem, removing the .htaccess in the media folder did the trick. I don't know if that's the best possible solution though! Thanks!
Change Options All -Indexes to Options -Indexes in the above mentioned .htaccess file.
copied all the system files from the FTP to my hard drive.
This one makes me a bit suspecting. Magento has case-sensitive folders in the media folder. There would be, for instance, an 'a' folder and an 'A' folder in the same location.
If you downloaded your files unarchived (file by file) via FTP to a Windows machine, this would cause a conflict and would omit up to half your images.
Ok, since everything checked out with the base URL, my next suggestion is a migration path option if you have cPanel on the old server, and since most do, this should help:
Create a full backup of the account using cPanel. This will create a tar.gz of the entire account.
Download the tarred backup to your computer and unzip.
Find home_dir.tar - this is what contains your HTML root information. You can either upload this directly to the server and untar there using SSH, or do it on your local computer and upload.
Find the SQL folder in the untarred backup. There should be a dump of your database there. Use source to put that information into a new database.
On the server, delete use_cache.ser and change config information for the new database.
Your .htaccess should have come over in the home_dir.tar, but make sure that it's correct per our other question
Once that's done, you should be fully functional, unless you need to make changes in the database base_url for the new server.
Images not showing in Magento 1.7 to 1.9 upgrade:
My solution:
in /media/.htaccess
fixed options syntax:
# Options ExecCGI Includes IncludesNOEXEC SymLinksIfOwnerMatch -Indexes
Options +ExecCGI +Includes +IncludesNOEXEC +SymLinksIfOwnerMatch -Indexes
removed these. Maybe conflict with .htaccess in site root directory??
# For security reasons, Option followsymlinks cannot be overridden.
# Options +FollowSymLinks
# Options +SymLinksIfOwnerMatch
# RewriteEngie on
also changed ownership of .htaccess to apache
chown apache:apache /var/www/mystore/media/.htaccess
Would like opinion of why these may be causing 500 errors.
php bin/magento catalog:images:resize
This helped me, but it take's a lot of time to complete
for magento 2.4.5
in pub//media/.htaccess
change „FollowSymLinks“ to „SymLinksIfOwnerMatch“. example:
############################################
enable rewrites
Options +SymLinksIfOwnerMatch
RewriteEngine on
## you can put here your pub/media folder path relative to web root
#RewriteBase /magento/pub/media/
############################################

Resources