Permalink
Browse files

Squashed merge of the final phpfog pull request

Conflicts:
	AUTHORS
	cloud_controller/app/models/app.rb
	cloud_controller/spec/staging/php_spec.rb
	cloud_controller/staging/apache_common/resources/generate_apache_conf
	cloud_controller/staging/manifests/php.yml
	cloud_controller/staging/php/plugin.rb

Change-Id: I638c125b777dca0139258295d2fbb37c16f30e21
  • Loading branch information...
1 parent 5aac6d7 commit 9082fbc5cb67b25db688cd326d02e9906287b55e Lucas Carlson committed with Patrick Bozeman Aug 25, 2011
Showing with 54 additions and 1 deletion.
  1. +3 −1 cloud_controller/staging/apache_common/resources/generate_apache_conf
  2. +51 −0 docs/php.md
@@ -74,7 +74,9 @@ File.open(File.expand_path(output_path), 'wb') do |file|
file.puts(template.result(binding))
end
-output_path = 'apache/php/php.ini'
+`cp -r /etc/php5/conf.d/* apache/php`
+
+output_path = 'apache/php/memory.ini'
template = <<-ERB
memory_limit = <%= php_ram %>
View
@@ -0,0 +1,51 @@
+# PHP Support
+
+## Architecture
+
+PHP applications are deployed using Apache and mod_php. For each CloudFoundry instance of the application, an Apache instance is started.
+
+## Demo: Installing Wordpress ##
+The Wordpress CMS can be run using CloudFoundry PHP support with very minimal changes.
+
+Steps to get the application to run:
+
+1. <code>curl -O http://wordpress.org/latest.tar.gz</code>
+2. <code>tar -xzf latest.tar.gz</code>
+3. <code>rm latest.tar.gz</code>
+4. <code>cd wordpress</code>
+5. <code>echo "<?php" > wp-salt.php</code>
+6. <code>curl https://api.wordpress.org/secret-key/1.1/salt/ >> wp-salt.php</code>
+7. Create wp-config.php, and set it to:
+
+ <?php
+ $services = getenv("VCAP_SERVICES");
+ $services_json = json_decode($services,true);
+ $mysql_config = $services_json["mysql-5.1"][0]["credentials"];
+
+ // ** MySQL settings from resource descriptor ** //
+ define('DB_NAME', $mysql_config["name"]);
+ define('DB_USER', $mysql_config["user"]);
+ define('DB_PASSWORD', $mysql_config["password"]);
+ define('DB_HOST', $mysql_config["hostname"]);
+ define('DB_PORT', $mysql_config["port"]);
+
+ define('DB_CHARSET', 'utf8');
+ define('DB_COLLATE', '');
+ define ('WPLANG', '');
+ define('WP_DEBUG', false);
+
+ require('wp-salt.php');
+
+ $table_prefix = 'wp_';
+
+ /* That's all, stop editing! Happy blogging. */
+
+ /** Absolute path to the WordPress directory. */
+ if ( !defined('ABSPATH') )
+ define('ABSPATH', dirname(__FILE__) . '/');
+
+ /** Sets up WordPress vars and included files. */
+ require_once(ABSPATH . 'wp-settings.php');
+8. <code>vmc push wordpresscf --url wordpresscf.vcap.me -n</code>
+9. <code>vmc create-service mysql --bind wordpresscf</code>
+10. Visit http://wordpresscf.vcap.me and enjoy your Wordpress install!

0 comments on commit 9082fbc

Please sign in to comment.