Hot answers tagged

15

Ok, Carlo, I'll get in this improved answer tonight, anyway, probably cut down and informate the other answer in morning here, so comments stay. I've got a sick animal here house-sitting for brother & family, why I'm a little slow. To accelerate what you have, it really depends on the content - whether you have logins or other personalization among your ...


13

I had this same issue and resolved it (at the suggestion of Craft CMS support) by enabling ImageMagick in the php.ini and restarting MAMP PRO. Per the MAMP PRO 3.0 user guide: The ImageMagick PHP module is included by default, but you must enable it inside the php.ini template file. Remove the ‘;’ from the following line. ;extension=imagick.so


12

Update for Craft 3 Craft 3 includes native support for multi-site installation. Here's a link to the official docs and here's a link to another question with more resources. Old answer for Craft 1 & 2 Credit to @LukeHolder for the original answer, but here's a bit more detailed and technical answer. Note, this might not be possible on all hosts. ...


11

Definitely not an nginx expert, but this has been working well for anyone that's tried it so far: server { listen 8080 default; charset utf8; server_name example.com; root /path/to/example.com/public; index index.php index.html; # Logs error_log /usr/local/etc/nginx/logs/example.com.error.log debug; access_log /usr/local/etc/nginx/logs/...


10

I'm going to answer this one, to share information on how I just did it. One issue will remain, but that will be raised in a separate question. The first thing is to understand the URL layout which CloudFlare/Railgun will require. You or your hoster will create A records in DNS for all but one of these, each of them pointing to your server IP. There's an ...


10

Yes, it is possible to have a Craft install on multiple domains and subdomains as long as you only access the control panel from a single domain and you only have a single installation of craft that all the domains and subdomains use. The limitation is all domains would be using the same url router and content - although for multi language content having ...


8

I had to run sudo php5enmod mcrypt to enable the module. It seems this has changed between 12.04 and 14.04—in 12.04 it was enabled automatically.


8

Craft rewrites the location of those files using a query string, which is what's causing nginx to lose track of them. Using the try_files directive should force nginx to find and serve them properly. location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { try_files $uri /index.php?$query_string; expires 7d; add_header Pragma "public"; add_header Cache-...


8

9 times out of 10, if you're absolutely sure the path is correct, it's either a permissions issue (PHP doesn't have permissions to open the craft folder) or your php.ini file has open_basedir restrictions in place preventing PHP from accessing the folder.


8

I had the same issue and solved it. This seems to be an issue with the exif lib. Try to disable mbstring overloading by setting mbstring.func_overload = 0 to your php.ini or php_admin_value mbstring.func_overload 0 in your apache virtual host configuration. Hope that helps -Oliver


8

This morning a couple of postings on Craft Slack #devops area linked good descriptions of basic server security, led by @merlingore there. Their instructions are tilted towards Ubuntu as far as specifics, but should fit for any Linux VPS. Recording the links here so we don't lose the patterns. I agree with them because they're actually the same as what I ...


7

There is a reasonable chance that this is due to a specific plugin. Try disabling all of your plugins, and see if the site is loading quickly again. If it is, try re-enabling each plugin one by one, to determine which of them may be causing the slowdown. It's important to remember that your plugins actually get loaded on every single page load, both front-...


7

Currently multi-site support isn't planned. If you want simple multi-site-support you could use the localization feature with a custom locale. But with Craft's auto-update's and easy deployment, why would you want to use MSM anyway? . ...we're pretty against adding it to Craft... at least in the way EE did it, where everything is stored on a per-site ...


7

Let me try to turn this into a more valuable StackExchange for others who will find it, since the original poster apparently got help and solved his problem without participating here. We can see so on the linked site, which is now running as expected for Craft, quite rapidly. What I'd like to do is suggest a less awkward way to approach his task. We can do ...


7

There are a few plugins which can handle this, but Retour is the newest and shiniest! https://github.com/nystudio107/retour It's from the same developer as SEOmatic... he puts a lot of love & attention into his plugins, so you know it's safe to rely on.


6

This Nginx-Craft configuration is one I've been using in production for some time, and it implements many best-practices that you might want to be using: https://github.com/nystudio107/nginx-craft


6

Craft has a twig redirect tag. You should be able to create a "redirect" template that handles redirects based on {slug} and/or url segments and then use Craft routes to direct "legacy-subdirectory" requests to your redirect template. I have not tested this.


5

Entirely possible. There is some discussion of having Craft installed in a load-balanced environment here. You'll want to have CRAFT_STORAGE_PATH point to a shared file system for all servers. If you have sticky sessions enabled at a load-balancer level, then PHP sessions won't be a problem. If not, then you'll want to set overridePhpSessionLocation to ...


5

It probably depends most on your hosting but following these instructions are probably your best bet: http://buildwithcraft.com/docs/installing The only exception being instead of "installing" you'd move your files up and import your database. If you are using github, it's as easy as "pulling" your code to your production server and importing the database ...


5

It turns out that I was running a dev release of PHP 5.6 from a PPA and not the official Ubuntu release. With Brad Bell's help (thank you so much!) I got on the right track to looking into PHP and realized that that was the problem. After purging the PPA and reverting to PHP 5.5.9 on the official Ubuntu repo, the problem seems to have gone away. Hopefully ...


5

You're asking a loaded question. I don't think there's a wrong answer here but if it were me, you have a couple options. Addressing the Elephant in the Room How good of a salesman are you? ;) You mention the e-commerce CMS isn't getting the job done but replacing it is off the table. I've gone down this road before. Since you've got your team interested ...


5

Yes, possible. You just need to override the URL routing within the subdirectory, so requests to /sub/* get routed to /sub/index.php rather than /index.php. For example, if you’re using Apache, just place Laravel’s .htaccess file within your subdirectory.


5

No reason at all, that should work perfectly fine. In fact, at least 90% of my projects keep files, database, and assets all on the same server. For the remaining 10%, I'm usually only moving the assets to Amazon S3. Everything else continues to live on the same server.


5

You can't use the domain .dev anymore, it's Google's gTLD (https://icannwiki.org/.dev) and they don't want to share. See https://medium.engineering/use-a-dev-domain-not-anymore-95219778e6fd for a detailed backstory. Instead, you should use the TLDs reserved by the IETF for this purpose, like .test. For reference, this is the HSTS List maintained by ...


4

The log file got me on my way after a tip from Brad Bell: 'CDbException' with message 'CDbCommand failed during the SQL statement: SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'craft_assetfiles' already exists' in ...craft/app/framework/db/CDbCommand.php:358 Removing the database and doing a fresh install solved the issue.


4

craftcms.conf root /srv/http/current-release/src/public; index index.php index.html index.htm; charset utf-8; # Force the latest IE version add_header "X-UA-Compatible" "IE=Edge"; error_page 404 /index.php; location / { # try_files $uri $uri/ /index.php?$query_string; try_files $uri $uri/ @rewrites; } location @rewrites { rewrite ^(.*) /...


4

As requested, here's a Varnish (3.x) configuration we use: https://gist.github.com/timkelty/35625a90a6819c8f7927 This is one setup for ExpressionEngine, but the only thing there really specific to that is the EE_PURGE request portion, which makes it work with: https://github.com/kevincupp/purge.ee2_addon We have it set up so site.com:8080 is the un-...


4

[Edit: I'm deprecating this answer, having a better one up now I believe, but leaving it as it's attracted very useful comments. I think what's said here isn't quite wrong, but has been considerably improved upon, and can be more so as the community gains experience. In particular, though for good reason, Railgun has turned out to be more naive than I ...


4

If your permissions are set correctly, your php.ini is all correct, your craft folder exists and everything seems like it should work fine... Make sure you have the app folder inside the craft folder as well. You'll get the "Could not find your craft/ folder." if there is no app folder.


4

If you enable devMode, then database profiling information (number of queries, SQL executed, execution time, etc.) as well as PHP script benchmarking information for the request will be output to your browser's console as well as the craft/storage/runtime/logs files. Also, as I understand it, every plugin is loaded on each request Installed and enabled ...


Only top voted, non community-wiki answers of a minimum length are eligible