| 354 | sudo chmod a+x php${major} mod_${php}.so |
| 355 | |
| 356 | Also edit httpd.conf: |
| 357 | The line |
| 358 | LoadModule php5_module mod_php55.so |
| 359 | should read |
| 360 | LoadModule php5_module ${moduledir}/mod_php55.so |
| 361 | Also add the following to the <IfModule mime_module> section: |
| 362 | AddType application/x-httpd-php .php |
| 363 | " |
| 364 | } |
| 365 | |
| 366 | ### Apache 24 handler SAPI ### |
| 367 | |
| 368 | subport ${php}-apache24handler { |
| 369 | description ${php} Apache 2 Handler SAPI |
| 370 | php.extensions apache2handler |
| 371 | |
| 372 | # regexp {^php\d+-(.+)$} apache2handler -> php.rootname |
| 373 | |
| 374 | long_description ${description} |
| 375 | |
| 376 | homepage http://www.php.net/install.unix.apache2 |
| 377 | |
| 378 | depends_lib-append port:apache24-devel |
| 379 | |
| 380 | set apxs ${prefix}/bin/apxs |
| 381 | set confdir ${prefix}/conf |
| 382 | set moduledir ${prefix}/lib/apache2/modules |
| 383 | |
| 384 | pre-configure { |
| 385 | # Checking for mod_cgi.so is a convenient way to verify apache2 is using its |
| 386 | # +preforkmpm variant. (+eventmpm and +workermpm instead provide mod_cgid.so.) |
| 387 | if {![file exists ${moduledir}/mod_cgi.so]} { |
| 388 | ui_error "To use ${subport}, apache24-devel must be installed with the +preforkmpm variant." |
| 389 | return -code error "incompatible apache24-devel installation" |
| 390 | } |
| 391 | } |
| 392 | |
| 393 | configure.args-append --with-apxs2=${apxs} |
| 394 | |
| 395 | build.target libs/libphp5.bundle |
| 396 | |
| 397 | destroot { |
| 398 | xinstall -m 755 -d ${destroot}${moduledir} ${destroot}${confdir}/extra |
| 399 | xinstall -m 644 ${worksrcpath}/libs/libphp5.so ${destroot}${moduledir}/mod_${php}.so |
| 400 | xinstall -m 644 ${filespath}/mod_php.conf ${destroot}${confdir}/extra/mod_${php}.conf |
| 401 | } |
| 402 | |
| 403 | notes-append " |
| 404 | |
| 405 | To enable ${subport}, run: |
| 406 | |
| 407 | cd ${moduledir} |
| 408 | sudo ${apxs} -a -e -n php${major} mod_${php}.so |
| 409 | sudo chmod a+x php${major} mod_${php}.so |
| 410 | |
| 411 | Also edit httpd.conf: |
| 412 | The line |
| 413 | LoadModule php5_module mod_php55.so |
| 414 | should read |
| 415 | LoadModule php5_module ${moduledir}/mod_php55.so |
| 416 | Also add the following to the <IfModule mime_module> section: |
| 417 | AddType application/x-httpd-php .php |