安装 Phalcon 也极其简单,只需要下载一个文件(php_phalcon.dll),
要以 phpinfo() 里面逗Architecture地属性为准!
把php_phalcon.dll 解压出来放在 {WampServer安装目录}/bin/PHP/php5.4/ext 目录下面,然后修改php.ini文件,PHP.ini配置文件增加参数逗extension=php_phalcon.dll地,
然后重启 Apache 服务就好了,重启后用phpinfo查看是否安装成功。
如果服务器报 500 internal server error,一般就是 Phalcon 版本和环境不统一。
比如逗Phalcon 1.1.0 - Windows x86 for PHP 5.4.0 NTS (VC9)地,就是给32位系统(x86)用的,对应的PHP版本是5.4.0(只要是5.4就可以,比如5.4.1也行)。
NTS是非线性安全的,如果你的phpinfo()显示逗Thread Safety地是逗enable地的状态,
那么你需要下载不带逗NTS地这个标志的。逗VC9地是用来标记编译器的,现在只有 VC9 的可以下载。
当然也可以根据 phpinfo() 里面的逗Compiler地属性去判断。
安装 Phalcon 时,不能以操作系统是多少位的来判断下载哪个安装包,而是要以 phpinfo() 里面逗Architecture地属性为准!
因为Phalcon 是作为PHP的扩展存在的,当然要以PHP是多少位的为准!
下载phalcon 把phalcon.dll 放到相关目录,一般是ext里面 在php.ini中添加 extension=phalcon.dll 重启环境print_r(preg_grep('/^phalcon/i', get_declared_classes()))
Array
(
[145] =>PhalconException
[146] =>PhalconDbAdapter
[147] =>PhalconDIInjectable
[148] =>PhalconDI
[149] =>PhalconFormsElement
[150] =>PhalconMvcModelValidator
[151] =>PhalconValidationValidator
[152] =>PhalconCacheBackend
[153] =>PhalconDbAdapterPdo
[154] =>PhalconDbDialect
[155] =>PhalconMvcModelMetaData
[156] =>PhalconAnnotationsAdapter
[157] =>PhalconLoggerFormatter
[158] =>PhalconLoggerAdapter
[159] =>PhalconFlash
[160] =>PhalconMvcModelBehavior
[161] =>PhalconDispatcher
[162] =>PhalconMvcModelResultset
[163] =>PhalconMvcViewEngine
[164] =>PhalconMvcModelException
[165] =>PhalconAssetsResource
[166] =>PhalconConfig
[167] =>PhalconSessionAdapter
[168] =>PhalconAclAdapter
[169] =>PhalconTranslateAdapter
[170] =>PhalconDIFactoryDefault
[171] =>PhalconMvcRouter
[172] =>PhalconTag
[173] =>PhalconAcl
[174] =>PhalconDb
[175] =>PhalconCacheException
[176] =>PhalconCacheMultiple
[177] =>PhalconCacheBackendApc
[178] =>PhalconCacheBackendFile
[179] =>PhalconCacheBackendMongo
[180] =>PhalconCacheBackendMemory
[181] =>PhalconCacheBackendMemcache
[182] =>PhalconCacheFrontendOutput
[183] =>PhalconCacheFrontendNone
[184] =>PhalconCacheFrontendJson
[185] =>PhalconCacheFrontendBase64
[186] =>PhalconCacheFrontendData
[187] =>PhalconTagSelect
[188] =>PhalconTagException
[189] =>PhalconPaginatorException
[190] =>PhalconPaginatorAdapterModel
[191] =>PhalconPaginatorAdapterQueryBuilder
[192] =>PhalconPaginatorAdapterNativeArray
[193] =>PhalconValidation
[194] =>PhalconValidationMessage
[195] =>PhalconValidationException
[196] =>PhalconValidationMessageGroup
[197] =>PhalconValidationValidatorEmail
[198] =>PhalconValidationValidatorRegex
[199] =>PhalconValidationValidatorIdentical
[200] =>PhalconValidationValidatorBetween
[201] =>PhalconValidationValidatorConfirmation
[202] =>PhalconValidationValidatorPresenceOf
[203] =>PhalconValidationValidatorExclusionIn
[204] =>PhalconValidationValidatorStringLength
[205] =>PhalconValidationValidatorInclusionIn
[206] =>PhalconDbIndex
[207] =>PhalconDbColumn
[208] =>PhalconDbAdapterPdoSqlite
[209] =>PhalconDbAdapterPdoMysql
[210] =>PhalconDbAdapterPdoOracle
[211] =>PhalconDbAdapterPdoPostgresql
[212] =>PhalconDbDialectOracle
[213] =>PhalconDbDialectMysql
[214] =>PhalconDbDialectSqlite
[215] =>PhalconDbDialectPostgresql
[216] =>PhalconDbException
[217] =>PhalconDbProfiler
[218] =>PhalconDbProfilerItem
[219] =>PhalconDbReference
[220] =>PhalconDbRawValue
[221] =>PhalconDbResultPdo
[222] =>PhalconAclRole
[223] =>PhalconAclResource
[224] =>PhalconAclAdapterMemory
[225] =>PhalconAclException
[226] =>PhalconText
[227] =>PhalconKernel
[228] =>PhalconSecurity
[229] =>PhalconSecurityException
[230] =>PhalconVersion
[231] =>PhalconSession
[232] =>PhalconSessionBag
[233] =>PhalconSessionException
[234] =>PhalconSessionAdapterFiles
[235] =>PhalconFilter
[236] =>PhalconDIException
[237] =>PhalconDIFactoryDefaultCLI
[238] =>PhalconDIService
[239] =>PhalconDIServiceBuilder
[240] =>PhalconFilterException
[241] =>PhalconFlashDirect
[242] =>PhalconFlashSession
[243] =>PhalconFlashException
[244] =>PhalconCLITask
[245] =>PhalconCLIRouter
[246] =>PhalconCLIConsole
[247] =>PhalconCLIConsoleException
[248] =>PhalconCLIDispatcher
[249] =>PhalconCLIDispatcherException
[250] =>PhalconCLIRouterException
[251] =>PhalconAnnotationsReader
[252] =>PhalconAnnotationsException
[253] =>PhalconAnnotationsReflection
[254] =>PhalconAnnotationsAnnotation
[255] =>PhalconAnnotationsCollection
[256] =>PhalconAnnotationsAdapterApc
[257] =>PhalconAnnotationsAdapterMemory
[258] =>PhalconAnnotationsAdapterFiles
[259] =>PhalconLoader
[260] =>PhalconLogger
[261] =>PhalconLoaderException
[262] =>PhalconLoggerItem
[263] =>PhalconLoggerMultiple
[264] =>PhalconLoggerException
[265] =>PhalconLoggerAdapterStream
[266] =>PhalconLoggerAdapterFile
[267] =>PhalconLoggerFormatterJson
[268] =>PhalconLoggerAdapterSyslog
[269] =>PhalconLoggerFormatterLine
[270] =>PhalconLoggerFormatterSyslog
[271] =>PhalconConfigException
[272] =>PhalconConfigAdapterIni
[273] =>PhalconFormsForm
[274] =>PhalconFormsManager
[275] =>PhalconFormsException
[276] =>PhalconFormsElementFile
[277] =>PhalconFormsElementText
[278] =>PhalconFormsElementDate
[279] =>PhalconFormsElementHidden
[280] =>PhalconFormsElementNumeric
[281] =>PhalconFormsElementSubmit
[282] =>PhalconFormsElementCheck
[283] =>PhalconFormsElementSelect
[284] =>PhalconFormsElementPassword
[285] =>PhalconFormsElementTextArea
[286] =>PhalconCrypt
[287] =>PhalconTranslate
[288] =>PhalconTranslateException
[289] =>PhalconTranslateAdapterNativeArray
[290] =>PhalconCryptException
[291] =>PhalconEscaper
[292] =>PhalconEscaperException
[293] =>PhalconAssetsManager
[294] =>PhalconAssetsException
[295] =>PhalconAssetsResourceJs [296] =>PhalconAssetsCollection
[297] =>PhalconAssetsResourceCss
[298] =>PhalconHttpCookie
[299] =>PhalconHttpRequest
[300] =>PhalconHttpResponse
[301] =>PhalconHttpCookieException
[302] =>PhalconHttpRequestFile
[303] =>PhalconHttpResponseCookies
[304] =>PhalconHttpResponseHeaders
[305] =>PhalconHttpRequestException
[306] =>PhalconHttpResponseException
[307] =>PhalconQueueBeanstalk
[308] =>PhalconQueueBeanstalkJob
[309] =>PhalconMvcUrl
[310] =>PhalconMvcView
[311] =>PhalconMvcMicro
[312] =>PhalconMvcModel
[313] =>PhalconMvcApplication
[314] =>PhalconMvcApplicationException
[315] =>PhalconMvcCollection
[316] =>PhalconMvcController
[317] =>PhalconMvcCollectionManager
[318] =>PhalconMvcCollectionException
[319] =>PhalconMvcDispatcher
[320] =>PhalconMvcDispatcherException
[321] =>PhalconMvcModelQuery
[322] =>PhalconMvcModelRow
[323] =>PhalconMvcMicroLazyLoader
[324] =>PhalconMvcMicroCollection
[325] =>PhalconMvcMicroException
[326] =>PhalconMvcModelMessage
[327] =>PhalconMvcModelCriteria
[328] =>PhalconMvcModelRelation
[329] =>PhalconMvcModelManager
[330] =>PhalconMvcModelTransaction
[331] =>PhalconMvcModelQueryLang
[332] =>PhalconMvcModelMetaDataFiles
[333] =>PhalconMvcModelMetaDataApc
[334] =>PhalconMvcModelQueryStatus
[335] =>PhalconMvcModelQueryBuilder
[336] =>PhalconMvcModelValidatorUrl
[337] =>PhalconMvcModelMetaDataMemory
[338] =>PhalconMvcModelResultsetComplex
[339] =>PhalconMvcModelValidationFailed
[340] =>PhalconMvcModelResultsetSimple
[341] =>PhalconMvcModelValidatorEmail
[342] =>PhalconMvcModelMetaDataSession
[343] =>PhalconMvcModelValidatorRegex
[344] =>PhalconMvcModelBehaviorSoftDelete
[345] =>PhalconMvcModelValidatorPresenceOf
[346] =>PhalconMvcModelValidatorUniqueness
[347] =>PhalconMvcModelTransactionFailed
[348] =>PhalconMvcModelTransactionManager
[349] =>PhalconMvcModelBehaviorTimestampable
[350] =>PhalconMvcModelMetaDataStrategyAnnotations
[351] =>PhalconMvcModelMetaDataStrategyIntrospection
[352] =>PhalconMvcModelTransactionException
[353] =>PhalconMvcModelValidatorStringLength
[354] =>PhalconMvcModelValidatorExclusionin
[355] =>PhalconMvcModelValidatorInclusionin
[356] =>PhalconMvcModelValidatorNumericality
[357] =>PhalconMvcRouterGroup
[358] =>PhalconMvcRouterRoute
[359] =>PhalconMvcRouterException
[360] =>PhalconMvcRouterAnnotations
[361] =>PhalconMvcUserPlugin
[362] =>PhalconMvcUserModule
[363] =>PhalconMvcUrlException
[364] =>PhalconMvcUserComponent
[365] =>PhalconMvcViewException
[366] =>PhalconMvcViewEnginePhp
[367] =>PhalconMvcViewEngineVolt
[368] =>PhalconMvcViewEngineVoltCompiler
[369] =>PhalconEventsEvent
[370] =>PhalconEventsManager
[371] =>PhalconEventsException)
备注:芝麻背调整理回答。芝麻背调,用技术推动行业进步。