1 | {% element 'hoge' %} |
1 | {% include 'Elements/fuga.tpl' %} |
1 | {% include 'Elements/fuga.ctp' %} |
1 | {% element 'hoge' %} |
1 | {% include 'Elements/fuga.tpl' %} |
1 | {% include 'Elements/fuga.ctp' %} |
1 2 3 4 5 6 7 8 | <?php echo $this->Html->getCrumbList( array( 'separator' => ' <span class="divider">/</span>' , 'class' => 'breadcrumb' ), array( 'text' => 'ホーム' , ) ); ?> |
1 2 3 4 5 6 7 8 9 10 11 12 13 | < IfModule mod_rewrite.c> RewriteEngine On RewriteBase /sandbox RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] # CGI版PHP用 BASIC認証の為 # CGI版PHPでは$_SERVER[’PHP_AUTH_USER’]と$_SERVER[’PHP_AUTH_PW’]が参照できない。 # でも下記の3行を追加すると使えるようになる RewriteEngine On RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule ^(.*) - [E=HTTP_AUTHORIZATION:%1] </ IfModule > |
1 | $ httpd - v |
Server version: Apache/2.2.24 (Unix) Server built: Jul 7 2013 18:05:17Apacheをスタートさせます
1 | $ sudo apachectl start |
1 2 3 4 5 6 7 8 | <html> <body> <h1> 私のサイト</h1> <p> こんにちは、世界</p> </body> </html> |
1 2 | $ cd /etc/apache2/users $ sudo nano {username}.conf |
1 2 3 4 5 6 | <directory "/Users/{username}/Sites/" > Options Indexes MultiViews AllowOverride All Order allow,deny Allow from all </Directory> |
1 2 | $ sudo cp Guest.conf {username}.conf $ sudo nano {username}.conf |
1 | $ sudo apachectl start |
1 | http://localhost/~{username}/ |
1 |
1 | $ php - v |
PHP 5.3.28 (cli) (built: Jan 23 2014 18:02:48) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend TechnologiesこのようにPhpは入っていますがそのままでは使えませんので。
1 2 3 | $ cd /etc/apache2 $ sudo cp httpd.conf httpd.conf.original $ sudo nano httpd.conf |
AllowOverride None
#LoadModule php5_module libexec/apache2/libphp5.so"#"を削除して保存します。
1 | $ sudo apachectl start |
<?php phpinfo();?>ブラウザーで http://localhost/~{username}/phpinfo.php を表示させます。
1 2 | sudo cp /etc/php .ini.default /etc/php .ini sudo nano /etc/php .ini |
curl -s http://php-osx.liip.ch/install.sh | bash -s 5.5
curl -s http://php-osx.liip.ch/install.sh | bash -s 5.4どちらか一つでも両方でもOK
1 2 3 4 5 6 | $ sudo nano /usr/local/php5/php .d /99-my .ini date .timezone = Asia /Tokyo $ /usr/local/php5/bin/php -i | grep timezone Default timezone => Asia /Tokyo date .timezone => Asia /Tokyo => Asia /Tokyo |
1 | $ export PATH= /usr/local/php5/bin :$PATH |
1 2 3 4 | $ cd ~ $ nano .bash_profile PATH= /usr/local/php5/bin :$PATH |
1 2 | $ sudo mv /etc/apache2/other/ +php-osx.conf /etc/apache2/other/ +php-osx.conf.none $ sudo nano /etc/apache2/httpd .conf |
1 2 | $ sudo rm -rf /usr/local/php5 * $ sudo rm -rf /usr/local/packager |
1 | $ export PATH= /usr/local/mysql/bin :$PATH |
1 2 3 4 | $ cd ~ $ nano .bash_profile PATH= /usr/local/mysql/bin :$PATH |
1 | PATH= /usr/local/mysql/bin : /usr/local/php5/bin :$PATH |
1 | $ mysqladmin -u root password 'パスワード文字列' |
1 | $ mysql -u root -p |
1 2 3 4 | $ cd /Library/WebServer $ sudo cp /Users/ {username} /Downloads/phpMyAdmin-x .x.x-all-languages.zip phpMyAdmin-x.x.x-all-languages.zip $ sudo unzip phpMyAdmin-x.x.x-all-languages.zip $ sudo ln -s phpMyAdmin-x.x.x-all-languages phpMyAdmin |
1 2 3 4 5 | $ cd phpMyAdmin $ sudo mkdir config $ sudo chgrp _www config $ sudo cp config.sample.inc.php config /config .inc.php $ sudo chmod -R g+wr config |
1 | $ sudo nano /etc/apache2/other/phpMyAdmin .conf |
<Directory "/Library/WebServer/phpMyAdmin"> Order allow,deny Allow from all </Directory> Alias /phpMyAdmin /Library/WebServer/phpMyAdminこれでApacheを再起動するとphpMyAdminが使えるようになります。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | <?php if (Configure::read( 'debug' ) == 0):?> <script type= "text/javascript" > $(document).ready( function (){ $( 'a[href^=#]' ).click( function () { var speed = 400; var href= $(this).attr( "href" ); var target = $(href == "#" || href == "" ? 'html' : href); var position = target.offset().top; $( 'body,html' ).animate({scrollTop:position}, speed, 'swing' ); return false; }); }); </script> <?php endif ;?> |
1 | echo $this ->Html->getCrumbList( array ( 'separator' => ' > ' ,), 'ホーム' ); |
1 2 | echo $this ->Html->getCrumbList( array ( 'separator' => ' > ' ,), |