PHP-FPM não é exibido em phpinfo ()

3

Eu instalei o php-fpm no Centos + Apache usando este manual - link mas o PHP-FPM não é exibido em phpinfo (). E eu não consigo descobrir o porquê.

OprocessoPHP-FPMestáinstaladoefuncionandobem:

#servicephp-fpmstatusphp-fpm(pid13349)isrunning...#servicephp-fpmconfigtest[29-Apr-201314:17:34]NOTICE:configurationfile/etc/php-fpm.conftestissuccessful

Meu/etc/php-fpm.conf:

;;;;;;;;;;;;;;;;;;;;;;FPMConfiguration;;;;;;;;;;;;;;;;;;;;;;;AllrelativepathsinthisconfigurationfilearerelativetoPHP'sinstall;prefix.;Includeoneormorefiles.Ifglob(3)exists,itisusedtoincludeabunchof;filesfromaglob(3)pattern.Thisdirectivecanbeusedeverywhereinthe;file.include=/etc/php-fpm.d/*.conf;;;;;;;;;;;;;;;;;;;GlobalOptions;;;;;;;;;;;;;;;;;;;[global];Pidfile;DefaultValue:nonepid=/var/run/php-fpm/php-fpm.pid;Errorlogfile;DefaultValue:/var/log/php-fpm.logerror_log=/var/log/php-fpm/error.log;Loglevel;PossibleValues:alert,error,warning,notice,debug;DefaultValue:notice;log_level=notice;IfthisnumberofchildprocessesexitwithSIGSEGVorSIGBUSwithinthetime;intervalsetbyemergency_restart_intervalthenFPMwillrestart.Avalue;of'0'means'Off'.;DefaultValue:0;emergency_restart_threshold=0;Intervaloftimeusedbyemergency_restart_intervaltodeterminewhen;agracefulrestartwillbeinitiated.Thiscanbeusefultoworkaround;accidentalcorruptionsinanaccelerator'ssharedmemory.;AvailableUnits:s(econds),m(inutes),h(ours),ord(ays);DefaultUnit:seconds;DefaultValue:0;emergency_restart_interval=0;Timelimitforchildprocessestowaitforareactiononsignalsfrommaster.;Availableunits:s(econds),m(inutes),h(ours),ord(ays);DefaultUnit:seconds;DefaultValue:0;process_control_timeout=0;SendFPMtobackground.Setto'no'tokeepFPMinforegroundfordebugging.;DefaultValue:yesdaemonize=no;;;;;;;;;;;;;;;;;;;;;PoolDefinitions;;;;;;;;;;;;;;;;;;;;;;See/etc/php-fpm.d/*.conf

/etc/php-fpm.d/www.conf

;Startanewpoolnamed'www'.[www];TheaddressonwhichtoacceptFastCGIrequests.;Validsyntaxesare:;'ip.add.re.ss:port'-tolistenonaTCPsockettoaspecificaddresson;aspecificport;;'port'-tolistenonaTCPsockettoalladdressesona;specificport;;'/path/to/unix/socket'-tolistenonaunixsocket.;Note:Thisvalueismandatory.;listen=127.0.0.1:9000listen=/var/run/php5-fpm.sock;Setlisten(2)backlog.Avalueof'-1'meansunlimited.;DefaultValue:-1listen.backlog=1000;Listofipv4addressesofFastCGIclientswhichareallowedtoconnect.;EquivalenttotheFCGI_WEB_SERVER_ADDRSenvironmentvariableintheoriginal;PHPFCGI(5.2.2+).Makessenseonlywithatcplisteningsocket.Eachaddress;mustbeseparatedbyacomma.Ifthisvalueisleftblank,connectionswillbe;acceptedfromanyipaddress.;DefaultValue:anylisten.allowed_clients=127.0.0.1;Setpermissionsforunixsocket,ifoneisused.InLinux,read/write;permissionsmustbesetinordertoallowconnectionsfromawebserver.Many;BSD-derivedsystemsallowconnectionsregardlessofpermissions.;DefaultValues:userandgrouparesetastherunninguser;modeissetto0666;listen.owner=nobody;listen.group=nobody;listen.mode=0666;Unixuser/groupofprocesses;Note:Theuserismandatory.Ifthegroupisnotset,thedefaultuser'sgroup;willbeused.;RPM:apacheChoosedtobeabletoaccesssomedirashttpduser=apache;RPM:Keepagroupallowedtowriteinlogdir.group=apache;Choosehowtheprocessmanagerwillcontrolthenumberofchildprocesses.;PossibleValues:;static-afixednumber(pm.max_children)ofchildprocesses;;dynamic-thenumberofchildprocessesaresetdynamicallybasedonthe;followingdirectives:;pm.max_children-themaximumnumberofchildrenthatcan;bealiveatthesametime.;pm.start_servers-thenumberofchildrencreatedonstartup.;pm.min_spare_servers-theminimumnumberofchildrenin'idle';state(waitingtoprocess).Ifthenumber;of'idle'processesislessthanthis;numberthensomechildrenwillbecreated.;pm.max_spare_servers-themaximumnumberofchildrenin'idle';state(waitingtoprocess).Ifthenumber;of'idle'processesisgreaterthanthis;numberthensomechildrenwillbekilled.;Note:Thisvalueismandatory.pm=dynamic;Thenumberofchildprocessestobecreatedwhenpmissetto'static'andthe;maximumnumberofchildprocessestobecreatedwhenpmissetto'dynamic'.;Thisvaluesetsthelimitonthenumberofsimultaneousrequeststhatwillbe;served.EquivalenttotheApacheMaxClientsdirectivewithmpm_prefork.;EquivalenttothePHP_FCGI_CHILDRENenvironmentvariableintheoriginalPHP;CGI.;Note:Usedwhenpmissettoeither'static'or'dynamic';Note:Thisvalueismandatory.pm.max_children=512;Thenumberofchildprocessescreatedonstartup.;Note:Usedonlywhenpmissetto'dynamic';DefaultValue:min_spare_servers+(max_spare_servers-min_spare_servers)/2pm.start_servers=16;Thedesiredminimumnumberofidleserverprocesses.;Note:Usedonlywhenpmissetto'dynamic';Note:Mandatorywhenpmissetto'dynamic'pm.min_spare_servers=10;Thedesiredmaximumnumberofidleserverprocesses.;Note:Usedonlywhenpmissetto'dynamic';Note:Mandatorywhenpmissetto'dynamic'pm.max_spare_servers=64;Thenumberofrequestseachchildprocessshouldexecutebeforerespawning.;Thiscanbeusefultoworkaroundmemoryleaksin3rdpartylibraries.For;endlessrequestprocessingspecify'0'.EquivalenttoPHP_FCGI_MAX_REQUESTS.;DefaultValue:0pm.max_requests=5000;TheURItoviewtheFPMstatuspage.Ifthisvalueisnotset,noURIwillbe;recognizedasastatuspage.Bydefault,thestatuspageshowsthefollowing;information:;acceptedconn-thenumberofrequestacceptedbythepool;;pool-thenameofthepool;;processmanager-staticordynamic;;idleprocesses-thenumberofidleprocesses;;activeprocesses-thenumberofactiveprocesses;;totalprocesses-thenumberofidle+activeprocesses.;Thevaluesof'idleprocesses','activeprocesses'and'totalprocesses'are;updatedeachsecond.Thevalueof'acceptedconn'isupdatedinrealtime.;Exampleoutput:;acceptedconn:12073;pool:www;processmanager:static;idleprocesses:35;activeprocesses:65;totalprocesses:100;Bydefaultthestatuspageoutputisformattedastext/plain.Passingeither;'html'or'json'asaquerystringwillreturnthecorrespondingoutput;syntax.Example:;http://www.foo.bar/status;http://www.foo.bar/status?json;http://www.foo.bar/status?html;Note:Thevaluemuststartwithaleadingslash(/).Thevaluecanbe;anything,butitmaynotbeagoodideatousethe.phpextensionorit;mayconflictwitharealPHPfile.;DefaultValue:notset;pm.status_path=/status;ThepingURItocallthemonitoringpageofFPM.Ifthisvalueisnotset,no;URIwillberecognizedasapingpage.Thiscouldbeusedtotestfromoutside;thatFPMisaliveandresponding,orto;-createagraphofFPMavailability(rrdorsuch);;-removeaserverfromagroupifitisnotresponding(loadbalancing);;-triggeralertsfortheoperatingteam(24/7).;Note:Thevaluemuststartwithaleadingslash(/).Thevaluecanbe;anything,butitmaynotbeagoodideatousethe.phpextensionorit;mayconflictwitharealPHPfile.;DefaultValue:notset;ping.path=/ping;Thisdirectivemaybeusedtocustomizetheresponseofapingrequest.The;responseisformattedastext/plainwitha200responsecode.;DefaultValue:pong;ping.response=pong;Thetimeoutforservingasinglerequestafterwhichtheworkerprocesswill;bekilled.Thisoptionshouldbeusedwhenthe'max_execution_time'inioption;doesnotstopscriptexecutionforsomereason.Avalueof'0'means'off'.;Availableunits:s(econds)(default),m(inutes),h(ours),ord(ays);DefaultValue:0;request_terminate_timeout=0;ThetimeoutforservingasinglerequestafterwhichaPHPbacktracewillbe;dumpedtothe'slowlog'file.Avalueof'0s'means'off'.;Availableunits:s(econds)(default),m(inutes),h(ours),ord(ays);DefaultValue:0;request_slowlog_timeout=0;Thelogfileforslowrequests;DefaultValue:notset;Note:slowlogismandatoryifrequest_slowlog_timeoutissetslowlog=/var/log/php-fpm/www-slow.log;Setopenfiledescriptorrlimit.;DefaultValue:systemdefinedvaluerlimit_files=102400;Setmaxcoresizerlimit.;PossibleValues:'unlimited'oranintegergreaterorequalto0;DefaultValue:systemdefinedvalue;rlimit_core=0;Chroottothisdirectoryatthestart.Thisvaluemustbedefinedasan;absolutepath.Whenthisvalueisnotset,chrootisnotused.;Note:chrootingisagreatsecurityfeatureandshouldbeusedwhenever;possible.However,allPHPpathswillberelativetothechroot;(error_log,sessions.save_path,...).;DefaultValue:notset;chroot=;Chdirtothisdirectoryatthestart.Thisvaluemustbeanabsolutepath.;DefaultValue:currentdirectoryor/whenchroot;chdir=/var/www;Redirectworkerstdoutandstderrintomainerrorlog.Ifnotset,stdoutand;stderrwillberedirectedto/dev/nullaccordingtoFastCGIspecs.;DefaultValue:no;catch_workers_output=yes;LimitstheextensionsofthemainscriptFPMwillallowtoparse.Thiscan;preventconfigurationmistakesonthewebserverside.Youshouldonlylimit;FPMto.phpextensionstopreventmalicioususerstouseotherextensionsto;exectutephpcode.;Note:setanemptyvaluetoallowallextensions.;DefaultValue:.php;security.limit_extensions=.php.php3.php4.php5;PassenvironmentvariableslikeLD_LIBRARY_PATH.All$VARIABLEsaretakenfrom;thecurrentenvironment.;DefaultValue:cleanenv;env[HOSTNAME]=$HOSTNAME;env[PATH]=/usr/local/bin:/usr/bin:/bin;env[TMP]=/tmp;env[TMPDIR]=/tmp;env[TEMP]=/tmp;Additionalphp.inidefines,specifictothispoolofworkers.Thesesettings;overwritethevaluespreviouslydefinedinthephp.ini.Thedirectivesarethe;sameasthePHPSAPI:;php_value/php_flag-youcansetclassicinidefineswhichcan;beoverwrittenfromPHPcall'ini_set'.;php_admin_value/php_admin_flag-thesedirectiveswon'tbeoverwrittenby;PHPcall'ini_set';Forphp_*flag,validvaluesareon,off,1,0,true,false,yesorno.;Defining'extension'willloadthecorrespondingsharedextensionfrom;extension_dir.Defining'disable_functions'or'disable_classes'willnot;overwritepreviouslydefinedphp.inivalues,butwillappendthenewvalue;instead.;DefaultValue:nothingisdefinedbydefaultexceptthevaluesinphp.iniand;specifiedatstartupwiththe-dargument;php_admin_value[sendmail_path]=/usr/sbin/[email protected];php_flag[display_errors]=offphp_admin_value[error_log]=/var/log/php-fpm/www-error.logphp_admin_flag[log_errors]=on;php_admin_value[memory_limit]=128M;Setsessionpathtoadirectoryownedbyprocessuserphp_value[session.save_handler]=filesphp_value[session.save_path]=/var/lib/php/session

/etc/httpd/conf.d/fastcgi.conf

UserapacheGroupapacheLoadModulefastcgi_modulemodules/mod_fastcgi.so#dirforIPCsocketfilesFastCgiIpcDir/var/run/mod_fastcgi#wrapallfastcgiscriptcallsinsuexecFastCgiWrapperOff#globalFastCgiConfigcanbeoverriddenbyFastCgiServeroptionsinvhostconfigFastCgiConfig-idle-timeout20-maxClassProcesses1#samplePHPconfig#see/usr/share/doc/mod_fastcgi-2.4.6forphp-wrapperscript#don'tforgettodisablemod_phpin/etc/httpd/conf.d/php.conf!##toenableprivilegeseparation,adda"SuexecUserGroup" directive
# and chown the php-wrapper script and parent directory accordingly
# see also http://www.brandonturner.net/blog/2009/07/fastcgi_with_php_opcode_cache/
#
#FastCgiServer /var/www/cgi-bin/php-wrapper
#AddHandler php-fastcgi .php
#Action php-fastcgi /cgi-bin/php-wrapper
#AddType application/x-httpd-php .php
#DirectoryIndex index.php
#
#<Location /cgi-bin/php-wrapper>
#    Order Deny,Allow
#    Deny from All
#    Allow from env=REDIRECT_STATUS
#    Options ExecCGI
#    SetHandler fastcgi-script
#</Location>


        <IfModule mod_fastcgi.c>
                DirectoryIndex index.html index.shtml index.cgi index.php
                AddHandler php5-fcgi .php
                Action php5-fcgi /php5-fcgi
                Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi
                FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -socket /var/run/php5-fpm.sock -pass-header Authorization
        </IfModule>

ATUALIZAÇÃO: ADICIONADO /etc/httpd/conf.d/php.conf:

#
# PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.
#
<IfModule prefork.c>
  LoadModule php5_module modules/libphp5.so
</IfModule>
<IfModule worker.c>
  LoadModule php5_module modules/libphp5-zts.so
</IfModule>

#
# Cause the PHP interpreter to handle files with a .php extension.
#
#AddHandler php5-script .php
#AddType text/html .php

#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php

#
# Uncomment the following line to allow PHP to pretty-print .phps
# files as PHP source code:
#
##AddType application/x-httpd-php-source .phps

ADICIONADO /etc/httpd/conf.d/php_cgi.conf:

scriptAlias /phppath/ "/var/www/cgi-bin/cgi_wrapper/"
Action php-script /phppath/cgi_wrapper

UPDATE, ADDED 2nd Screenshot abaixo:

Alguém pode sugerir onde está o problema?

    
por Kelvin 29.04.2013 / 20:39

2 respostas

1

Ok, eu encontrei onde estava o problema.

Eu tinha mais 2 arquivos de configuração em /etc/httpd/conf.d (provavelmente criados pelo Parallels Plesk Panel):

  • /etc/httpd/conf.d/fcgid.conf
  • /etc/httpd/conf.d/php_cgi.conf

Eu comentei tudo dentro e agora o php-fpm está ativo (como mostrado nas screenshots no meu post acima).

Obrigado!

    
por 29.04.2013 / 21:25
0

PHP-FPM é uma implementação FastCGI , então o que está sendo mostrado em phpinfo () é perfeitamente preciso .

    
por 29.04.2013 / 20:52