<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>giancarlospot - desarrollo web &#187; PHP</title>
	<atom:link href="http://www.giancarlospot.com/categoria/php/feed" rel="self" type="application/rss+xml" />
	<link>http://www.giancarlospot.com</link>
	<description></description>
	<lastBuildDate>Fri, 02 Jul 2010 18:16:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Todos los paises del mundo en un arreglo de PHP</title>
		<link>http://www.giancarlospot.com/php/todos-los-paises-del-mundo-en-un-arreglo-de-php.html</link>
		<comments>http://www.giancarlospot.com/php/todos-los-paises-del-mundo-en-un-arreglo-de-php.html#comments</comments>
		<pubDate>Wed, 12 May 2010 23:57:04 +0000</pubDate>
		<dc:creator>giancarlo</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.giancarlospot.com/?p=330</guid>
		<description><![CDATA[Este arreglo que les doy, les puede servir para ponerlo directamente en un combobox o meterlo en la base de datos, ya ustedes hacen el bucle y el insert. Espero les sirva. Por cierto, estos paises los saqué de Wikipedia el 12 de mayo de 2010. array&#40;'Afganistán' , 'Albania' , 'Alemania' , 'Andorra' , 'Angola' [...]]]></description>
			<content:encoded><![CDATA[<p>Este arreglo que les doy, les puede servir para ponerlo directamente en un combobox o meterlo en la base de datos, ya ustedes hacen el bucle y el insert. Espero les sirva. Por cierto, estos paises los saqué de <a href="http://enciclopedia.us.es/index.php/Pa%C3%ADses_del_mundo_A-Z" target="_blank">Wikipedia </a>el 12 de mayo de 2010.<br />
<span id="more-330"></span></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">array<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Afganistán'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Albania'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Alemania'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Andorra'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Angola'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Antigua y Barbuda'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Antillas Holandesas'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Arabia Saudí'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Argelia'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Argentina'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Armenia'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Aruba'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Australia'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Austria'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Azerbaiyán'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Bahamas'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Bahrein'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Bangladesh'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Barbados'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Bélgica'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Belice'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Benín'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Bermudas'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Bielorrusia'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Bolivia'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Botswana'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Bosnia'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Brasil'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Brunei'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Bulgaria'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'BurkinaFaso'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Burundi'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Bután'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Cabo Verde'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Camboya'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Camerún'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Canadá'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Chad'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Chile'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'China'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Chipre'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Colombia'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Comoras'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Congo'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Corea del Norte'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Corea del Sur'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Costa de Marfil'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Costa Rica'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Croacia'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Cuba'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Dinamarca'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Dominica'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Dubai'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Ecuador'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Egipto'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'El Salvador'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Emiratos Árabes Unidos'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Eritrea'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Eslovaquia'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Eslovenia'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'España'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Estados Unidos de América'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Estonia'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Etiopía'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Fiyi'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Filipinas'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Finlandia'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Francia'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Gabón'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Gambia'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Georgia'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Ghana'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Grecia'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Guam'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Guatemala'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Guayana Francesa'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Guinea-Bissau'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Guinea Ecuatorial'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Guinea'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Guyana'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Granada'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Haití'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Honduras'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'HongKong'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Hungría'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Holanda'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'India'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Indonesia'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Irak'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Irán'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Irlanda'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Islandia'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Islas Caimán'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Islas Marshall'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Islas Pitcairn'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Islas Salomón'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Israel'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Italia'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Jamaica'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Japón'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Jordania'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Kazajstán'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Kenia'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Kirguistán'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Kiribati'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Kósovo'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Kuwait'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Laos'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Lesotho'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Letonia'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Líbano'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Liberia'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Libia'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Liechtenstein'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Lituania'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Luxemburgo'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Macedonia'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Madagascar'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Malasia'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Malawi'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Maldivas'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Malí'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Malta'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Marianas del Norte'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Marruecos'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Mauricio'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Mauritania'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'México'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Micronesia'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Mónaco'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Moldavia'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Mongolia'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Montenegro'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Mozambique'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Myanmar'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Namibia'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Nauru'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Nepal'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Nicaragua'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Níger'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Nigeria'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Noruega'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'NuevaZelanda'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Omán'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'OrdendeMalta'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Países Bajos'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Pakistán'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Palestina'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Palau'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Panamá'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Papúa Nueva Guinea'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Paraguay'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Perú'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Polonia'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Portugal'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Puerto Rico'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Qatar'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Reino Unido'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'República Centro africana'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'República Checa'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'República del Congo'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'República Democrática del Congo'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'República Dominicana'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Ruanda'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Rumania'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Rusia'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Sáhara Occidental'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'SaintKitts-Nevis'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Samoa Americana'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Samoa'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'San Marino'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Santa Lucía'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Santo Tomé y Príncipe'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'San Vicente y las Granadinas'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Senegal'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Serbia'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Seychelles'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'SierraLeona'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Singapur'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Siria'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Somalia'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'SriLanka'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Sudáfrica'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Sudán'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Suecia'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Suiza'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Suazilandia'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Tailandia'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Taiwán'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Tanzania'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Tayikistán'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Tíbet'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'TimorOriental'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Togo'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Tonga'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Trinidad y Tobago'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Túnez'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Turkmenistán'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Turquía'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Tuvalu'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Ucrania'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Uganda'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Uruguay'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Uzbequistán'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Vanuatu'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Vaticano'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Venezuela'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Vietnam'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'WallisyFutuna'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Yemen'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Yibuti'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Zambia'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Zaire'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'Zimbabue'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.giancarlospot.com/php/todos-los-paises-del-mundo-en-un-arreglo-de-php.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Thumb con PHP y si es necesario recortar la imagen</title>
		<link>http://www.giancarlospot.com/php/thumb-con-php-y-si-es-necesario-recortar-la-imagen.html</link>
		<comments>http://www.giancarlospot.com/php/thumb-con-php-y-si-es-necesario-recortar-la-imagen.html#comments</comments>
		<pubDate>Fri, 03 Apr 2009 01:28:15 +0000</pubDate>
		<dc:creator>giancarlo</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[GD]]></category>
		<category><![CDATA[Imágenes]]></category>
		<category><![CDATA[Recortar]]></category>
		<category><![CDATA[Thumbs]]></category>

		<guid isPermaLink="false">http://www.giancarlospot.com/?p=247</guid>
		<description><![CDATA[Con PHP y su librería GD podemos crear thumbnail de una imagen fácilmente. Vamos a crear una función que se llame CrearThumb y le mandaremos los siguientes parámetros: Imagen Original, Imagen de Destino, Ancho Original, Alto Original, Nuevo Ancho, Nuevo Alto y La Calidad de la Imagen. Al momento de llamar a esta funcion, en [...]]]></description>
			<content:encoded><![CDATA[<p>Con <a href="http://www.php.net">PHP</a> y su librería <a href="http://www.php.net/manual/es/ref.image.php">GD</a> podemos crear thumbnail de una imagen fácilmente. Vamos a crear una función que se llame CrearThumb y le mandaremos los siguientes parámetros: Imagen Original, Imagen de Destino, Ancho Original, Alto Original, Nuevo Ancho, Nuevo Alto y La Calidad de la Imagen.<br />
<span id="more-247"></span></p>
<p>Al momento de llamar a esta funcion, en los dos primeros parámetros hay que dar el nombre de los archivos pero con la ruta absoluta del servidor.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> CreateThumb<span style="color: #009900;">&#40;</span>$pImageOrigen<span style="color: #339933;">,</span> $pImageDestino<span style="color: #339933;">,</span> $pWidth<span style="color: #339933;">,</span> $pHeight<span style="color: #339933;">,</span> $pMaxWidth<span style="color: #339933;">,</span> $pMaxHeight<span style="color: #339933;">,</span> $pCalidad<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #006600; font-style: italic;">// SI WIDTH ES MAS ALTO, LO CORTO POR WIDTH Y VICEVERSA</span>
		<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>$pWidth <span style="color: #339933;">&gt;</span> $pHeight<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			$_porcentaje <span style="color: #339933;">=</span> $pMaxHeight<span style="color: #339933;">*</span><span style="color: #CC0000;">100</span><span style="color: #339933;">/</span>$pHeight<span style="color: #339933;">;</span>
			$_height <span style="color: #339933;">=</span> $pMaxHeight<span style="color: #339933;">;</span>
			$_width <span style="color: #339933;">=</span> ceil<span style="color: #009900;">&#40;</span>$_porcentaje<span style="color: #339933;">*</span>$pWidth<span style="color: #339933;">/</span><span style="color: #CC0000;">100</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
			$_porcentaje <span style="color: #339933;">=</span> $pMaxWidth<span style="color: #339933;">*</span><span style="color: #CC0000;">100</span><span style="color: #339933;">/</span>$pWidth<span style="color: #339933;">;</span>
			$_width <span style="color: #339933;">=</span> $pMaxWidth<span style="color: #339933;">;</span>
			$_height <span style="color: #339933;">=</span> ceil<span style="color: #009900;">&#40;</span>$_porcentaje<span style="color: #339933;">*</span>$pHeight<span style="color: #339933;">/</span><span style="color: #CC0000;">100</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		$_pic <span style="color: #339933;">=</span> <span style="color: #339933;">@</span>imagecreatefromjpeg<span style="color: #009900;">&#40;</span>$pImageOrigen<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		$_tmp <span style="color: #339933;">=</span> imagecreatetruecolor<span style="color: #009900;">&#40;</span>$pMaxWidth<span style="color: #339933;">,</span> $pMaxHeight<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		imagecopyresized<span style="color: #009900;">&#40;</span>$_tmp<span style="color: #339933;">,</span> $_pic<span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> $_width<span style="color: #339933;">,</span> $_height<span style="color: #339933;">,</span> $pWidth<span style="color: #339933;">,</span> $pHeight<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		imagejpeg<span style="color: #009900;">&#40;</span>$_tmp<span style="color: #339933;">,</span> $pImageDestino<span style="color: #339933;">,</span> $pCalidad<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		imagedestroy<span style="color: #009900;">&#40;</span>$_pic<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		imagedestroy<span style="color: #009900;">&#40;</span>$_tmp<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Con esta función se creará un thumb. Claro que si los tamaños originales de la imagen son proporcionales a los nuevos tamañas de la imagen, no cortará la imagen. Pero si ese no es el caso, la imagen será cortada luego de ser reducida lo máximo posible.</p>
<p>Hagan la prueba!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.giancarlospot.com/php/thumb-con-php-y-si-es-necesario-recortar-la-imagen.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Convertir video o audio a FLV con PHP y FFMPEG</title>
		<link>http://www.giancarlospot.com/php/convertir-video-o-audio-a-flv-con-php-y-ffmpeg.html</link>
		<comments>http://www.giancarlospot.com/php/convertir-video-o-audio-a-flv-con-php-y-ffmpeg.html#comments</comments>
		<pubDate>Sat, 21 Mar 2009 21:26:39 +0000</pubDate>
		<dc:creator>giancarlo</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[ffmpeg]]></category>
		<category><![CDATA[FLV]]></category>
		<category><![CDATA[FLVTool2]]></category>

		<guid isPermaLink="false">http://www.giancarlospot.com/?p=224</guid>
		<description><![CDATA[Igual que youtube, nosotros con unas pocas líneas de código en PHP podemos convertir nuestro videos o audios a formato FLV automáticamente con PHP. Con este artículo podrán hacer, por ejemplo, una administración de una galería de videos y/o audios para luego ser vistos o escuchados, respectivamente, en su web por un player hecho en [...]]]></description>
			<content:encoded><![CDATA[<p>Igual que <a href="http://www.youtube.com/" target="_blank">youtube</a>, nosotros con unas pocas líneas de código en <a href="http://www.php.net" target="_blank">PHP</a> podemos convertir nuestro videos o audios a formato <a href="http://www.cristalab.com/tutoriales/tutorial-de-flash-video-flv-para-flash-c84l/" target="_blank">FLV</a> automáticamente con PHP. Con este artículo podrán hacer, por ejemplo, una administración de una galería de videos y/o audios para luego ser vistos o escuchados, respectivamente, en su web por un player hecho en <a href="http://www.adobe.com/products/flash/" target="_blank">Adobe Flash</a>.</p>
<p>El FFMPEG puede ser utilizado en <a href="http://www.ffmpeg.org/download.html" target="_blank">Linux</a> como en <a href="http://www.videohelp.com/tools/ffmpeg" target="_blank">Windows</a>. Además con el <a href="http://osflash.org/flvtool2" target="_blank">FLVTool2</a> podemos manipular el FLV para que tenga lo necesario para poder correr nuestro FLV en un player hecho en Flash.</p>
<p>Veamos sencillamente cómo convertir un WMV a FLV con el FFMPEG</p>
<p><span id="more-224"></span>Este ejemplo lo vamos a hacer en Windows pero recuerden que es igual en Linux, solo que no vamos a tener los ejecutables  en la misma carpeta como en Windows, el FFMPEG y FLVTool2 se instalan en Linux. Para este caso copiamos nuestros ejecutables del FFMPEG y FLTool2 en la carpeta &#8220;C:\videos&#8221;. Yo voy a tener el archivo mivideo.wmv en &#8220;C:\videos&#8221; para no tener que escribir otras rutas en la línea de comando.</p>
<p>Así estaría la carpeta</p>
<p><img class="aligncenter size-full wp-image-230" title="Carpeta de videos, FFMPEG y FLVTool2" src="http://www.giancarlospot.com/wp-content/uploads/2009/03/ffmpeg_videos.jpg" alt="Carpeta de videos, FFMPEG y FLVTool2" width="450" height="280" /></p>
<p>Abrimos Command</p>
<p><img class="aligncenter size-full wp-image-229" title="Command Windows" src="http://www.giancarlospot.com/wp-content/uploads/2009/03/cmd.jpg" alt="Command Windows" width="450" height="225" /></p>
<p>Ahora escribimos el línea básica para convertir mi video mivideo.wmv a mivideo.flv. <strong>&#8220;ffmpeg -y -i mivideo.wmv -f flv -vcodec flv -acodec mp3 -s 320&#215;240 -ar 22050 mivideo.flv&#8221;</strong></p>
<p><img class="aligncenter size-full wp-image-231" title="Command FFMPEG" src="http://www.giancarlospot.com/wp-content/uploads/2009/03/cmd_ffmpeg.jpg" alt="Command FFMPEG" width="450" height="224" />Lo que indica, en rasgos generales, en esa línea es que con mivideo.wmv vamos a crear el mismo video pero en formato FLV y su nombre será mivideo.flv, aunque este archivo exista vamos a reemplazarlo, el tamaño será de 320&#215;240 px.  y tendrá un 22050 Hz. Utilizaremos el codec MP3, para audio y el codec MPEG para video.</p>
<p>Si queremos convertir un audio a FLV, sería la misma línea solo que no ponemos el codec de video ni las dimensiones, por obvias razones.</p>
<p>Si escriben &#8220;ffmpeg&#8221; en la línea de comandos aparecerán todas las alternativas que pueden utilizar.</p>
<p><a class="thickbox" title="Opciones del FFMPEG" href="http://www.giancarlospot.com/html_ajax/opciones_ffmpeg.html?height=450&amp;width=900">Opciones del FFMPEG</a></p>
<p>Ahora veamos el FLVTool2, es sencillo también. Solo escribimos <strong>&#8220;flvtool2 -UPx mivideo.flv&#8221;</strong>. Luego de escribir esto verán, en el Command, un formato XML, éste te muestra las propiedades que recuperó del video o audio que formateamos. Con este XML podemos recuperar información valiosa como la duración del video por ejemplo. Podemos guardar este XML de esta manera <strong>&#8220;flvtool2 -UPx mivideo.flv &gt; mivideo.xml&#8221;</strong>.</p>
<p>Algo valioso del FFMPEG es que podemos tomar un frame del video y guardarlo en JPEG. Fácilmente con <strong>&#8220;ffmpeg -i mivideo.flv -vframes 70 -s 120&#215;90 -f image2 -y mivideo.jpg&#8221;</strong><br />
Estamos diciendo que cogemos el frame 70 y guardamos la imagen con las dimensiones 120&#215;90 px.</p>
<p>Ok, y donde entra el PHP? Bueno simple, nosotros con el comando &#8220;<a href="http://www.php.net/manual/es/function.exec.php" target="_blank">exec</a>&#8221; podemos correr lineas de comando con PHP. Esto quiere decir que si en PHP podemos utilizar cualquiera de las líneas que he comentado, por ejemplo</p>
]]></content:encoded>
			<wfw:commentRss>http://www.giancarlospot.com/php/convertir-video-o-audio-a-flv-con-php-y-ffmpeg.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Smarty desde cero</title>
		<link>http://www.giancarlospot.com/php/smarty-desde-cero.html</link>
		<comments>http://www.giancarlospot.com/php/smarty-desde-cero.html#comments</comments>
		<pubDate>Fri, 06 Mar 2009 03:21:46 +0000</pubDate>
		<dc:creator>giancarlo</dc:creator>
				<category><![CDATA[Freelancers]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[metodología]]></category>
		<category><![CDATA[smarty]]></category>

		<guid isPermaLink="false">http://www.giancarlospot.com/?p=178</guid>
		<description><![CDATA[Smarty es un framework en PHP que te ayuda a trabajar con plantillas y así separar el código de la vista. Esto nos puede ayudar a utilizar el patrón MVC. Cuando programas es bueno tener una buena metodología y separar la lógica de negocio de tu diseño, así podrás separar las tareas de los diseñadores [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.smarty.net/" target="_blank">Smarty</a> es un framework en PHP que te ayuda a trabajar con plantillas y así separar el código de la vista. Esto nos puede ayudar a utilizar el patrón <a href="http://es.wikipedia.org/wiki/Modelo_Vista_Controlador" target="_blank">MVC</a>. Cuando programas es bueno tener una buena metodología y separar la lógica de negocio de tu diseño, así podrás separar las tareas de los diseñadores (armadores) y los programadores.</p>
<p>Con este video van a poder aprender a utilizar el Smarty desde cero</p>
<p><span id="more-178"></span></p>
<div style="text-align: center;"></div>
<p><script src="/js/swfobject.js"></script><br />
 <script type="text/javascript"><!--
var so = new SWFObject('/swf/player.swf','player','449','386','8');
so.useExpressInstall('/swf/expressinstall.swf');
so.addParam('allowfullscreen','true');
so.addParam('allowscriptaccess','always');
so.addParam('flashvars','file=/videos/smarty_desde_cero.flv&#038;image=/images/videos/smarty.jpg');
so.addParam("wmode", "opaque");
so.write('video_flash');
// --></script></p>
<p><a href="http://smarty.net/manual/es/" target="_blank">Aquí podrás ver la documentación del Smary en español</a></p>
<p>No se olviden de comentar</p>
]]></content:encoded>
			<wfw:commentRss>http://www.giancarlospot.com/php/smarty-desde-cero.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>JSON &#8211; PHP y Javascript</title>
		<link>http://www.giancarlospot.com/php/json-php-y-javascript.html</link>
		<comments>http://www.giancarlospot.com/php/json-php-y-javascript.html#comments</comments>
		<pubDate>Wed, 18 Feb 2009 02:13:36 +0000</pubDate>
		<dc:creator>giancarlo</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[json]]></category>

		<guid isPermaLink="false">http://miblog.giancarlospot.com/?p=52</guid>
		<description><![CDATA[JSON, que significa &#8220;JavaScript Object Notation&#8221;, nos sirve para el intercambio de información entre diferentes lenguajes sin la necesidad de utilizar XML. &#8220;Es un subconjunto de la notación literal de objetos de JavaScript que no requiere el uso de XML&#8221;. Así como utilizamos XML para mandar información, JSON nos puede servir para lo mismo, solo [...]]]></description>
			<content:encoded><![CDATA[<p>JSON, que significa &#8220;JavaScript Object Notation&#8221;, nos sirve para el intercambio de información entre diferentes lenguajes sin la necesidad de utilizar XML. <a href="http://es.wikipedia.org/wiki/JSON" target="_blank">&#8220;Es un subconjunto de la notación literal de objetos de JavaScript que no requiere el uso de XML&#8221;</a>. Así como utilizamos XML para mandar información, JSON nos puede servir para lo mismo, solo que tiene otra estructura, más corta y, así poder mandar e interpretar información entre diferentes lenguajes de programación.</p>
<p><span id="more-52"></span><br />
Un ejemplo de cómo se ve un JSON es:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#123;</span><span style="color: #3366CC;">&quot;titulo&quot;</span><span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;Título 1&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;descripcion&quot;</span><span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;Descripción 1&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
<span style="color: #009900;">&#123;</span><span style="color: #3366CC;">&quot;titulo&quot;</span><span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;Título 2&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;descripcion&quot;</span><span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;Descripción 2&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
<span style="color: #009900;">&#123;</span><span style="color: #3366CC;">&quot;titulo&quot;</span><span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;Título 3&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;descripcion&quot;</span><span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;Descripción 3&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#93;</span></pre></div></div>

<p>Para crear este código con PHP, desde la versión 5.2.6 es muy sencillo, ya que vienen las funciones json_encode y json_decode. La función &#8220;json_encode&#8221; convierte los arreglos en cadenas de texto en formato JSON y, el &#8220;json_decode&#8221; convierte cadenas de texto con formato JSON a arreglos, un ejemplo:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"> <span style="color: #0000ff;">&quot;Título 1&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;descripcion&quot;</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;Descripción 1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$arreglo</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;titulo&quot;</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;Título 2&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;descripcion&quot;</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;Descripción 2&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$arreglo</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;titulo&quot;</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;Título 3&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;descripcion&quot;</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;Descripción 3&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #990000;">json_encode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$arreglo</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
?<span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span></pre></div></div>

<p>Veamos un ejemplo en video:</p>
<div style="text-align: center;"><object width="445" height="364" data="http://www.youtube.com/v/b0UZzbltZG8&amp;hl=en&amp;fs=1&amp;color1=0xe1600f&amp;color2=0xfebd01&amp;border=1" type="application/x-shockwave-flash"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/b0UZzbltZG8&amp;hl=en&amp;fs=1&amp;color1=0xe1600f&amp;color2=0xfebd01&amp;border=1" /><param name="allowfullscreen" value="true" /></object></div>
]]></content:encoded>
			<wfw:commentRss>http://www.giancarlospot.com/php/json-php-y-javascript.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Urls amigables con .htaccess</title>
		<link>http://www.giancarlospot.com/php/urls-amigables-con-htaccess.html</link>
		<comments>http://www.giancarlospot.com/php/urls-amigables-con-htaccess.html#comments</comments>
		<pubDate>Sun, 15 Feb 2009 01:11:57 +0000</pubDate>
		<dc:creator>giancarlo</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[Apache]]></category>

		<guid isPermaLink="false">http://miblog.giancarlospot.com/?p=20</guid>
		<description><![CDATA[Seguramente han visto muchas páginas webs donde la URL del tema que estás viendo es igual al título de éste. Seguramente habrán pensado que el archivo realmente se llama así, pero no es así en todos los casos. Cómo podríamos hacer esto si en realidad es el mismo archivo para todos los temas, pero la [...]]]></description>
			<content:encoded><![CDATA[<p>Seguramente han visto muchas páginas webs donde la URL del tema que estás viendo es igual al título de éste. Seguramente habrán pensado que el archivo realmente se llama así, pero no es así en todos los casos. Cómo podríamos hacer esto si en realidad es el mismo archivo para todos los temas, pero la información es jalada de una base de datos? ¿Para qué sirve? ¿Cómo podemos hacer esto? ¿Es difícil?</p>
<p><span id="more-20"></span></p>
<p>Esto sirve mucho para <a href="http://www.altas-buscadores.com" target="_blank">posicionarnos</a> mejor en los buscadores de Internet, como <a href="http://www.google.com" target="_blank">Google</a>, habrán visto que muchos blogs tienen las urls de esta forma. Sabemos que las palabras claves en nuestras páginas ayudan a posicionarnos, el título de la página, el contenido, entre otras cosas. Pero de hecho la URL dice mucho de la información que se muestra, cómo podemos hacer esto si utilizamos un archivo y con éste podemos mostrar diferentes cosas, ya que sacamos la información de la base de datos. El apache tiene un módulo llamado &#8220;rewrite&#8221;, si este módulo está activado podemos utilizar el <a title="Tutorial del .htaccess" href="http://httpd.apache.org/docs/1.3/howto/htaccess.html" target="_blank">.htaccess</a> que nos sirve para varias cosas y una de ellas para utilizar las &#8220;URLS amigables&#8221;.</p>
<p>Bueno ya más o menos entienden por donde va la cosa, mejor vamos a explicarlo con un video.</p>
<div style="text-align: center;"><object width="445" height="364" data="http://www.youtube.com/v/0GmYndzhCuw&amp;hl=en&amp;fs=1&amp;color1=0xe1600f&amp;color2=0xfebd01&amp;border=1" type="application/x-shockwave-flash"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/0GmYndzhCuw&amp;hl=en&amp;fs=1&amp;color1=0xe1600f&amp;color2=0xfebd01&amp;border=1" /><param name="allowfullscreen" value="true" /></object></div>
]]></content:encoded>
			<wfw:commentRss>http://www.giancarlospot.com/php/urls-amigables-con-htaccess.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Instalar Apache 2.2, PHP y MySQL para Windows</title>
		<link>http://www.giancarlospot.com/php/instalar-apache-2-2-php-y-mysql-para-windows.html</link>
		<comments>http://www.giancarlospot.com/php/instalar-apache-2-2-php-y-mysql-para-windows.html#comments</comments>
		<pubDate>Sat, 24 Jan 2009 00:44:53 +0000</pubDate>
		<dc:creator>giancarlo</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://miblog.giancarlospot.com/?p=1</guid>
		<description><![CDATA[Para empezar mi primer blog quisiera explicar cómo instalar Apache, PHP y MySQL ya que hay muchos tutoriales de PHP desde cero, buenos, pero no te explican cómo hacer que corra el PHP en tu máquina. Primero que todo, estos pasos son muy fáciles, no tenemos la necesidad de utilizar algún software que te instala [...]]]></description>
			<content:encoded><![CDATA[<p>Para empezar mi primer blog quisiera explicar cómo instalar <a href="http://www.apache.org/" target="_blank">Apache</a>, <a href="http://www.php.net" target="_blank">PHP</a> y <a href="http://www.mysql.com/" target="_blank">MySQL</a> ya que hay muchos <a href="http://www.giancarlospot.com/categoria/php">tutoriales de PHP</a> desde cero, buenos, pero no te explican cómo hacer que corra el PHP en tu máquina. Primero que todo, estos pasos son muy fáciles, no tenemos la necesidad de utilizar algún software que te instala el paquete entero, primero que todo porque corre un servicio, en tu PC, del software y no te instala el PHP completamente, entre otras cosas. Para mi, una persona que no sabe instalar estos 3 softwares y sabe programar, solo es una persona mecánica, lo mejor es saber desde el principio cómo funciona todo, si vas a aprender algo, apréndelo bien.</p>
<p><span id="more-1"></span><br />
Primero que nada debemos descargar el <a title="Descargar Apache" href="http://httpd.apache.org/download.cgi" target="_blank">Apache</a>, <a title="Descargar PHP" href="http://www.php.net/downloads.php" target="_blank">PHP</a> y <a title="Descargar MySQL" href="http://dev.mysql.com/downloads/" target="_blank">MySQL</a>.</p>
<p><strong>Instalación del APACHE:</strong></p>
<p>Debes descargar el Win32 Binary including OpenSSL 0.9.8i (MSI Installer), este será un instalador normal para windows.</p>
<p>Lo único que debes cambiar, recomendablemente, es el directorio donde se debe guardar el apache <strong>C:\apache</strong></p>
<p>Ahora debemos configurar el apache para que sepa donde se encuentra el PHP (sé que aun no lo instalamos, pero si sigues los pasos de este artículo no vas a tener problemas)</p>
<p>Te diriges a <strong>C:\apache\conf</strong> y encontrarás un archivo llamado <strong>httpd.conf</strong> ábrelo y busca una lista donde aparezcan varios <strong>&#8220;LoadModule&#8221; </strong>arriba de toda esta lista, o abajo, copia esta línea</p>
<p><strong>LoadModule php5_module &#8220;C:/php/php5apache2_2.dll&#8221;</strong></p>
<p>Luego<strong> </strong>busca la palabra &#8220;AddType&#8221;, al final del último AddType escribe esta línea</p>
<p><strong>AddType application/x-httpd-php .php</strong></p>
<p>Si vas a usar phtml puedes poner</p>
<p><strong>AddType application/x-httpd-php .phtml</strong></p>
<p>Así puedes jugar con las extensiones que quieras usar.</p>
<p>Al final de todo el documento, escribe</p>
<p><strong>PHPIniDir &#8220;c:/php&#8221;</strong></p>
<p>Ahora busca<strong> </strong>&lt;Directory &#8220;C:/apache/cgi-bin&#8221;&gt; y cambia todo por</p>
<p><strong>&lt;Directory &#8220;C:/apache/cgi-bin&#8221;&gt;<br />
AllowOverride None<br />
Options None<br />
Order allow,deny<br />
Allow from all<br />
&lt;/Directory&gt;</strong></p>
<p>Y abajo de esto escribes</p>
<p><strong>&lt;Directory &#8220;C:/php&#8221;&gt;<br />
AllowOverride None<br />
Options None<br />
Order allow,deny<br />
Allow from all<br />
&lt;/Directory&gt;</strong></p>
<p>Para configurar tu página de inicio busca la palabra index.html y puedes cambiar toda esa línea por</p>
<p><strong>DirectoryIndex index.php index.html</strong></p>
<p>Ahora dejemos el Apache a un lado.</p>
<p><strong>Instalación del PHP</strong></p>
<p>Para el PHP solo debemos descargar el código fuente y lo pones en C:\php (osea la versión ZIP, no el instalador)</p>
<p>Luego de esto debemos configurar el php.ini</p>
<p>Cuando descargamos el PHP ponemos toda la información en C:\php y buscamos el archivo <strong>php.ini-recommended</strong>, le cambiamos el nombre a <strong>php.ini</strong>, ahora configuarlo</p>
<p>Primero veamos si el módulo del MySQL está activado, busca <strong>&#8220;extension=php_mysql.dll&#8221;</strong> y si tiene un <strong>&#8220;;&#8221;</strong> quítalo, eso significa que está comentada esa línea. Ahora busca la línea  <strong>&#8220;doc_root&#8221;</strong> y ponlo así <strong>doc_root = C:\apache\htdocs </strong>y luego busca extension_dir y cambias toda la línea por<strong> extension_dir = &#8220;C:\php\ext&#8221; </strong>si tiene un ; (punto y coma) quítaselo<strong>.<br />
</strong></p>
<p>¿Por qué esa línea? Porque le estamos diciendo al PHP que el Apache entiende que los archivos que están en ese directorio son los que va a leer como archivos PHP e interpretará su código. Hasta ahí con el PHP</p>
<p><strong>Instalación del MySQL</strong></p>
<p>Éste es el más sencillo, es solamente un instalador común de windows. En la gran mayoría de cosas dale siguiente, pero no olvides de activar el modo mysql command y no te olvides de tu password, si es que lo pones. El usuario predeterminado es <strong>&#8220;root&#8221;</strong></p>
<p>Ok, ya deberíamos estar listos. Luego de esto abramos el notepad, o un editor de texto, y escribamos</p>
<p>&lt;?php phpinfo(); ?&gt;</p>
<p>Guardemoslo en <strong>C:\apache\htdocs</strong> como <strong>phpinfo.php</strong></p>
<p>Ahora entremos al navegador y escribamos <strong>http://localhost/phpinfo.php</strong></p>
<p><strong>Nota:</strong><br />
<em>Ya alguna vez he tenido un problema, sobre todo cuando usé Windows 7, el apache se reiniciaba cuando hacía un mysql_connect. Y lo arreglé copiando el dll &#8220;libmysql.dll&#8221; que está en la raíz de la carpeta php y lo copié a la carpeta &#8220;bin&#8221; del apache y por si acaso en la carpeta &#8220;ext&#8221; de php</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.giancarlospot.com/php/instalar-apache-2-2-php-y-mysql-para-windows.html/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
