I am looking for a clean, well-built CMS. I want to migrate a number of sites away from a self-built CMS which I will not be developing further.
I've come across Apostrophe and instantly fell in love with the great, integrated user interface.
It is based on the Symfony framework, which I have practically no experience with.
My questions:
I am planning to deploy sites I build with this CMS on shared hosting packages which do not offer any command line access. I know that many of Symfony's development and maintenance functions rely on command line access to the symfony script. Is it feasible to deploy an Apostrophe-based web site to such a web host, or is access to the command line tools required for a live product on a regular basis?
To be very honest, I'm not really keen on learning Symfony in depth right now: I'm sure it's a great framework, but I have tons of other obligations. I just really like what Apostrophe offers to the end user of the CMS. In your opinion as a seasoned Symfony or even Apostrope developer, will a professional PHP developer be able to set up a web site (without much customization on the code end - lots on the front-end, but that's a different matter) without being a Symfony expert? Or is this a recipe for disaster?
Are there any other arguments that, from your experience, speak for or against using Apostrophe in my situation?
I'm one of the core Apostrophe developers at P'unk Avenue.
Right now Apostrophe's open source release is oriented toward folks who are willing to get somewhat up to speed with Symfony, yes, at least so far as understanding the layout of a Symfony project and learning to edit templates. You need those skills to add new page templates and edit the global layout.
You don't have to create entirely new PHP classes to launch and maintain an Apostrophe site, though. Sometimes "light PHP" skills (creating new templates) are all that is required.
Usually the Apostrophe ecosystem works like this: a client wants to work with us, or with another developer, to create a site that they can then maintain on their own without the usual problems of the client accidentally trashing the design, busting the layout with horrible HTML pasted from Microsoft Word, et cetera.
Apostrophe solves that problem very thoroughly with robust built-in HTML filters and media slots that aggressively manage images and video so that they display correctly for a given page template and so on.
So we take the problem of helping clients (who are very competent in their own knowledge domain, but not designers) to maintain their own content safely very seriously and have some unique solutions as standard equipment in the system.
As for your hosting situation though, yes, it is difficult to use Apostrophe (or other really modern PHP code) with zero command line access. Symfony tasks are used to clear the Symfony cache and to reoptimize the search engine nightly. You could work around the former with some other hack to empty the cache folder and the latter by ignoring it, which will work if the site is small.
Another problem with shared hosting is that it won't have APC running as a bytecode cache. Without APC pretty much all PHP code runs much much much slower. Systems with a lot of PHP classes are not meant to be run without APC and they appear much slower than is really accurate without APC.
I would strongly urge you to check out the offerings of ServerGrove (www.servergrove.com). When your client can have a virtual machine all to themselves for $20/month with all the security benefits that brings, I think it's a questionable decision not to go for it. (Use whatever host you want, the main principle here is that VM hosting is always vastly more secure and performs much better than old-school shared hosting. ServerGrove does specialize in Symfony hosting though which is a nice plus.)
Some shared hosting services are not completely terrible in this regard - servergrove does have a shared hosting offering, still no APC (which is a serious disadvantage for any big PHP system, including WordPress or Drupal) but they do give you shell access and secure the system by preventing other clients from being able to find your files through the filesystem via PHP. Some shared hosts don't do that at all, which is a horrendous security hole.
There is an apostrophenow community to help you along:
http://groups.google.com/group/apostrophenow
Whatever you choose, good luck with your site!
Related
My team is relatively new to Drupal. One thing we have struggled to understand is how to work with it from a DevOps point of view. I realize this is too large a subject for one question so I have a more specific question that gets at the heart of the matter.
How does one provision a Drupal instance? By "provision", I mean create a provisioning script that builds my CMS (we're only using Drupal for that purpose) starting with a clean virtual machine with only OS and web server. The script would install and configure Drupal and its modules and connect to an existing database containing my content. Or perhaps I can even have it add my content to Drupal instance with an empty database. I'm just not sure what makes sense.
What I am trying to avoid is the uncertainty and non-reproducability that comes with doing everything interactively via Drupal's UI. I realize that Drupal has lots of techniques for exporting various things but there doesn't appear to be any coherent overall picture. Every bit of advice is of the form, "If you want to do (some specific thing), this is how you might do it." Or, even worse, "This worked for me." Neither of these things gives me much confidence or, more importantly, gives decent "best practices" advice that tells us what Drupal's designers intended.
There are some Drupal "best practices" articles but they don't go much beyond advice such as, "Do a backup before changing anything." I need more useful advice.
Yes, in Drupal 7 the Features module allow configuration export to code. Then on deployment, a single command (executable from CLI using Drush) can be used to sync. the in-database configuration from the code.
The features is now native in Drupal 8 and is called configuration management.
Drupal is a Database driven application and in that case snapshot of db has to be released as well.
Pre-deployment step would be to create db and dump the snapshot.
You can run post-deployment scripts to configure environment specific configuration.
I've an already developed and running social website like 'Facebook'.
This website has been developed using PHPFox v3.0.7(which is a social networking platform created in php).
The website functions are working well, no issues with them.
The main, major and serious issue I'm facing with the website is the slow execution speed. For any kind of operation it takes too much time and user has to wait for that much time. This really irritates the user and is affecting the performance of a website.
So, I did research on 'Facebook'- The World's Largest Social Networking Website developed in PHP. If 'Facebook' can execute at rapid speed in spite of heavy user load and continuous operations why can't my site?
First thing is the site is developed using a framework called 'PHPFox' so the entire Database design, caching and all other things have been managed by the framework itself, I can't change the framework's settings but ultimately I want to increase the execution speed of my website.
So how should I achieve it? If you have any best in class solution please provide me the guidance for it.
Any kind of help would be highly appreciated.
Please feel free to ask me any of the queries you have regarding the issue I'm facing.
Thanks.
There are several ways you can increase the speed.
Using CDN,
Enable caching,
Using load balancing server,
Enable compression,
Enabling bootstrap,
Optimize database and db driver
You can use the following server speedup method
Enabling mod_deflacte
Enabling memchached
I have faced the same problem earlier when working on PHPFox and most of the things can be handled from the admin control panel.
By using memcached, i have resolved the speed issue. You can follow the simple steps which are mentioned in the knowledge base of PHPFox and i hope you will find some solution. how-to-enable-memcached
First of all facebook uses HHMV(HipHop Virtual Machine) which is an execution engine for PHP, ie their PHP code is first transformed into intermediate HipHop bytecode (HHBC), which is then dynamically translated into the x86-64 machine code, optimized and natively executed.
Thus everytime you login to facebook ,you just run the highly
efficient machine code.
I assume your site do not have HHMV , so here are some few tools & tips to boost PHP running websites,
memcached
cassandra
Optimizing db driver
Using msqli instead of mysql
Using a server with better configuration.
Using minified versions of jquery & bootstrap (ie bootstrap.min.js & jquery.min.js).
Hi In your main question, what you are asking is for the advice to increase the performance of your PHPFox application. Whereas, in the different note section, you are looking for the solution to send the Push-Notifications.
I will be answering you regarding the 'Increasing the performance of your website'.
As you must be aware, performance tuning/optimization is the bigger task. It has various stages as listed by '#Myself Malay'. Some of them can be done quick and others will take time. So you need to know them, prioritize them. For ex: Reducing the requests of JS and CSS files, by making them load using the CDN, can be accomplished quickly. Serving your resources (HTML, CSS, JS) in compressed form (gzip) also can be done quickly.
Optimizing your queries will be time consuming. Enabling Cache should be quick. If you want to establish the load balancers then it will take some time.
Here, I am adding some reference links regarding the PHPFox, which will help you.
http://www.ipragmatech.com/phpfox3-performance-xcache-apc-memcached.html#.VXkzXt93M_M
How to optimize your database tables in PHPFox
Speedup PHPFox V3
PHPFox - Optimization Settings
Note: Some of the tweaks may require the modification of the core files. Be careful, while doing so as they will make auto-update very difficult. Always take your code and DB backup during modification to your core files. Make a document about the changes you have done as which files, where why etc, which will help you to re-apply all those changes again, in case of updating your code to new version.
Below, I am adding some of the links, which will help you in understanding the Performance Optimization to the next level
Books for Building Scalable Web Applications? (DB Performance/Tuning, Networking, General Performance, etc.)
Scalability and Performance of Web Applications, Approaches?
My personal favorite book is: Scaling PHP Applications by Steve Corona. This book is the best reference ever available for the PHP Developers.
Eventhough I am not able to give any direct solution to your problem, hope this helps upto certain extent. All the best :-)
First of all, stop comparing your Phpfox site with Facebook. Facebook has hundreds of thousands of programmers working day and night to keep the performance up. It is a horrable truth that PHP is a slow server side scripting language. If your site improves, it's performance goes down. Fortunately, there are some tools available that can be used for increasing the overall performance of your website. Some of them are Memcached, Cassendra, Varnix etc. You can use CD networks to serve data faster. Choosing a good hosting server also helps to make your site ready for heavy traffic.
Facebook uses over 100 unique technologies to keep the site going with a respectable speed. Hiphop PHP is a technology that was developed by the company itself and is used to compile PHP scripts faster than any native C++ compiler. Hiphop makes PHP Codes to execute 30-50% faster. Well, HHVM is an alternative to Hiphop PHP and is available for free but requires nginx. Think again, moving from Apache to nginx is not a good decision if you are just a beginner.
I'm in the process of building a rather big web application with PHP + Codeigniter. When I first began this project I was excited by the hosting provider PHPFog product of PHP-as-a-service. The idea of simply developing my application and not having to worry about server maintenance, setup, securing, etc appealed to me.
However, I've had far too many issues with PHPFog to be comfortable trusting it with hosting my application. I've run into situations where I've deleted a file from my git repository, pushed it to my remote repo at phpfog, and wound up with the file not actually being removed on one or all of my application servers. The service is also supposed to provide newrelic for application monitoring however this only worked briefly and hasn't worked at all since August 10th despite numerous complaints. And their customer service is far from satisfactory in helping solve all of these problems.
So now I'm considering alternatives, and Heroku has caught my attention. Heroku seems like a much more mature cloud application platform. However it does not provide PHP hosting. Instead it provides ROR, Java, Node.js, and Clojure.
How difficult would it be for someone with a lot of experience in PHP (and the Codeigniter framework) to learn Ruby + Rails and rebuild an application? Both organize code in the MVC pattern, so I hope that means my views would only require modification of their hooks to match ruby's syntax. I've already designed my database and all of the SQL queries to access the data I need from my models in CI. What do you guys think?
EDIT 1:
So I've watched this video as an introduction to ROR development:
http://www.youtube.com/watch?v=Gzj723LkRJY
And my initial reaction is 'So ROR is like a coloring book?' I'm skeptical when I see huge chunks of an application come together via something as simple 'scaffolding.' I don't know what to think other than I'm afraid that ROR sacrifices some of the granularity/control I'm used to with php
EDIT 2:
I've recently discovered https://cloudcontrol.com/ They appear to offer the same type of hosting with PHP-as-a-service that PHPFog offers but with more control, such as the ability to directly access your database and auto-scaling. Still the great idea of a git-push to deploy to multiple servers without having to deal with setting them up manually. The only thing I dislike is that their datacenters are based in Ireland (Amazon AWS). However they told me that they're planning on moving to the US in the next 3 months and offering pricing in USD.
While yes they both are MVC, yes both Ruby and PHP are scripting languages, and yes you shouldn't require much modification to your views other than changing the php hooks to ruby hooks, I think you are fooling yourself if you think it is just an easy conversion.
Ruby as a language is IMO far superior to PHP. It allows you to do so much more with so much less code. If you were to convert your PHP code to Ruby code by replacing each call with its equivalent, you wouldn't be doing it the Ruby way.
On top of that, Rails as a framework is far more mature and powerful than CodeIgniter. It will provide you far greater flexibility and convention-based help that you will code things a lot differently than if you were using CI.
Added to that, you will want to use ActiveRecord as your ORM and should write database migrations to create your database, so all those SQL scripts you have written will be pretty much useless.
If you decide that porting your app to RoR is the way to go, then I wholeheartedly encourage you to take some time and learn Ruby and Rails, and then rewrite your application as if you were doing a Rails app from scratch. You'll be amazed at how quickly you can get a project up and running.
Before this question turns into the typical Ruby vs PHP discussion, and before you embark on an (almost) impossible task, you should consider other hosting providers. There are many to choose from, some of whom offer this "PHP as a service" you're looking for.
http://vps.net/
http://mediatemple.net/
http://rackspace.com/
Please realize that porting a PHP application to ROR or Ruby is not an easy task. You may as well start again (in a language you know little about, no doubt). You shouldn't base your programming language on bad hosting experience or whatever that guy said. Use what you're comfortable with.
This one is a must read for you
http://www.oreillynet.com/ruby/blog/2007/09/7_reasons_i_switched_back_to_p_1.html
I am planing to build a website using PHP to be hosted on the public internet with decent user load (between 1000 to 5000). I am using FreeBSD as a server and I configured Apache, PHP and MySQL from scratch.
With proper configuration, is it safe to use such a server, or should I go with some web framework? I am asking as I've heard few horrible things about PHP.
If it is safe, does PHP get too complex when the size of the site increases beyond a certain point?
I know Facebook uses PHP; are there any other big websites that use PHP?
Last, is it recommended to use some PHP framework or should I stick to plain old PHP?
PHP works fine for just about any size server. The question isn't really the programming language but the infrastructure you set up. 1000-5000 users is not very many unless they are all banging on the site at the same time. Are they doing a lot of DB queries or consuming a lot of CPU resources? If so, then you may want to look at a dedicated MySQL server for the DB queries.
I have nothing against frameworks. However, you are usually shoehorning your problem into their solution. Careful design on your part with common routines, etc., are usually just as good as a framework in my opinion. However, some people are more comfortable working within a framework because it removes some of the plumbing issues.
A lot of large sites use PHP. It may not be obvious because they hide the extension of the scripts in the URLs.
With proper configuration PHP is fine. However if youre new to php and server administration you might want to read up on configuring php as well as Apache for security. Youll also need to read specifics on configuration for performance as well but you need to have an app to test before its really worth doing that beyond some basics.
As far as using a framework or just basic PHP that depends totally on you. a framework is othing more really than a set of useful code and structure to accomplish alot of tasks. If you dont use a framework youre going to have to write code that meets similar requirements, so you might save time using a framework. Generally you are going to sacrifice performance in trade for having to design/write less code. You need to decide yourself if a framework (and which one) is right for the project.
In terms of sites that use php... There are a ton... Facebook, Yahoo Bookmarks, Daily Motion, parts of MySpace (at one time, not sure if its still the case), anything running Drupal or Wordpress... PHP is more than capable.
PHP is just a tool and choice of framework does not really makes your application secure or fast, unless you understand the principles of web security and how things works.
Facebook is good example of what php is capable of in hands of processionals. And there are plenty of websites that capable to handle 10K visitors a day on a single low end server.
I've spent some time now developing a web application in php. It has mostly been just for the fun of learning as a side project, but the app now has a few users which I don't want to upset by breaking things as I develop.
At the moment, I have a very rudimentary method for managing the development - I use a text editor (ultraedit) to write the code and use its built in ftp to upload the files to the server. In terms of version control I have 2 domains, and only push files to the "live" domain when they work, but that's it. The domains are hosted on a cPanel shared hosting site which I have some doubts about its ability to handle even minor spikes in traffic. I looked at slicehost yesterday for something more scalable but that looks like a bit of a learning curve from where I am now.
I know I could do better than this, but where to start? I think I need advice on three things
1 - code writing tool
2 - version control / management
3 - scalable hosting
I've deliberately asked these in the same question as I'd like to know if one choice impacts another. Is there a good integrated solution?
Thanks in advance as ever.
Each part of your question has been answered before. The list below lists some of the common tools to use and links to appropriate searches on StackOverflow. There is no all in one package and going into details about these tools in one question is out of scope, so I am afraid you have to do some digging:
SVN, Git or Mercurial
UnitTesting (PHPUnit or SimpleTest)
Continuous Integration
Phing (for deployment)
phpqatools.org
Netbeans or Eclipse (for an IDE)
Disclaimer: list is not meant to be complete and order is not important
There is a lot going on here. I'll give you my two cents though.
I used to use ultra edit. Now I use netbeans, its a fully integrated development environment and it makes my life soooo much easier. Its free too. I can't imagine ever going back to UltraEdit. Also, which brings me to number two, netbeans has SVN and CVS integration
I would use subversion for version control. In my experience it does everything you need for version control. Others use ones like git and mercurial, but I think SVN is widely supported and easy enough to set up. As far as pushing code to the server, i've begun using svn for this too. I first ssh into the server and checkout the code into the public_html directory, and then set up an alias to do svn updates through the command line... its way easier than ftping in my opinion. There are other deployment methods, but i've never used them. see this question:
What is your preferred php deployment strategy?
obviously shared hosting is not going to handle traffic as well as a dedicated server. But there are lots of things you can do to improve performance before moving to a dedicated server. Check out this article: http://developer.yahoo.com/performance/rules.html
It seems that you're after a robust deployment strategy as opposed to a development one. But, correct me if I'm wrong.
In terms of 'code writing tool', and
IDE choice is a subjective
discussion. Feel free to work with
the one you are most comfortable
with, for me this is Netbeans.
As for a deployment strategy, I think it was best summed up in this answer.
Your point about scalable hosting is fairly broad. We will need much better forcasted metrics to give better advice. However, for now, if scalable hosting is a worry then maybe look into some sort of Cloud Hosting.
Have you looked at using wamp/xamp/mamp/lamp for development locally? Uploading via ftp for every change is a pain.
You could do that for local and see that everything works, then push it to your test domain and run through it again and then finally push live.
Might want to look at something like SpringLoops for doing your version control - this has the advantage of doing the deploy and then if it goes pear shaped you can revert it (free account gets 3 deploys a day).
I wouldn't worry about scaleable hosting just now, just focus on the site and the coding, you've only got a few users - wait till it starts becoming a problem before moving (however, I suggest looking into options) but don't try and get all cloud ready - might not ever be a problem.
ps, go with Linode over Slicehost.
I think use Aptana Studio ( http://www.aptana.org ). It is an Eclipse based IDE with all the tools you need integrated in it. It has integrated PHP development tools, GIT or SVN for version control.
I've used shared hosting as well. Once an other site on the same server had DoS atacks and my site became unreachable as well. Otherwise it could work in reasonable speed after some optimization. It served 1000-3000 users per day.
Dedicated servers are much better. Or you can use Amazon web services. I know they are more expensive.
1 - code writing tool
Zend Studio. I would recommend Linux as well if you are going to use linux servers.
2 - version control / management
SVN + phing (if you are going to build serious applications).
3 - scalable hosting
Amazon or RackSpace.
For your editor, just use what you are comfortable and productive with. You most definitely should have version control in place. You never know when you need to rollback a version or two.
I always keep at least 3 versions on the production server. I use symlinks to point the web server at the latest version. If there is a problem, you just need to recreate the symlink to point to an older version.
As for shared hosting, you'd be surprised out how much bandwidth you can get. I have a $10/month shared host that gets about 500K page views a month. Generally, it's not that your shared host can't handle the load, it's that the hosting provider puts too many "shares" on the same server. So it depends on how much resources everyone else on the same server is using. If you are having issues, you can always ask to be moved to a different server.