Foros del Web » Administración de Sistemas » Apache »

Error al abrir un archivo php

Estas en el tema de Error al abrir un archivo php en el foro de Apache en Foros del Web. Pues hace poco que me instalé un servidor apache, el 2.2 para ser más exactos. Descargué php 4.4 desde la web de php (intenté descargar ...
  #1 (permalink)  
Antiguo 09/01/2007, 14:41
Avatar de sumolari  
Fecha de Ingreso: mayo-2006
Ubicación: localhost
Mensajes: 1.367
Antigüedad: 18 años
Puntos: 18
Error al abrir un archivo php

Pues hace poco que me instalé un servidor apache, el 2.2 para ser más exactos. Descargué php 4.4 desde la web de php (intenté descargar el 5.2, pero el antiirus me bloqueó su acceso a internet y el instalador no acaba...). Según el libro con el que voy aprendiendo php, había que modificar el archivo httpd.conf, pero ya estaba modificado, aparecía como decía el libro (con Script alias /php / etc etc). La cosa es que cuando abro un archivo php empiezan a aparecer una serie de ventanitas de error diciendo que no se puede iniciar y un montón de archivos en diversas ventanitas... Pero he comprobado por qué es y no lo entiendo, todo parece bien...
  #2 (permalink)  
Antiguo 09/01/2007, 14:43
Avatar de sumolari  
Fecha de Ingreso: mayo-2006
Ubicación: localhost
Mensajes: 1.367
Antigüedad: 18 años
Puntos: 18
Re: Error al abrir un archivo php

Texto de httpd.conf:
Cita:
#
# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.2/> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
# consult the online docs. You have been warned.
#
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with "/" (or "drive:/" for Win32), the
# server will use that explicit path. If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "logs/foo.log"
# with ServerRoot set to "C:/Program Files/Apache Software Foundation/Apache2.2" will be interpreted by the
# server as "C:/Program Files/Apache Software Foundation/Apache2.2/logs/foo.log".
#
# NOTE: Where filenames are specified, you must use forward slashes
# instead of backslashes (e.g., "c:/apache" instead of "c:\apache").
# If a drive letter is omitted, the drive on which Apache.exe is located
# will be used by default. It is recommended that you always supply
# an explicit drive letter in absolute paths, however, to avoid
# confusion.
#

# ThreadsPerChild: constant number of worker threads in the server process
# MaxRequestsPerChild: maximum number of requests a server process serves
ThreadsPerChild 250
MaxRequestsPerChild 0

#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# Do not add a slash at the end of the directory path. If you point
# ServerRoot at a non-local disk, be sure to point the LockFile directive
# at a local disk. If you wish to share the same ServerRoot for multiple
# httpd daemons, you will need to change at least LockFile and PidFile.
#
ServerRoot "C:/Program Files/Apache Software Foundation/Apache2.2"

#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses (0.0.0.0)
#
#Listen 12.34.56.78:80
Listen 80

#
# Dynamic Shared Object (DSO) Support
#
# To be able to use the functionality of a module which was built as a DSO you
# have to place corresponding `LoadModule' lines at this location so the
# directives contained in it are actually available _before_ they are used.
# Statically compiled modules (those listed by `httpd -l') do not need
# to be loaded here.
#
# Example:
# LoadModule foo_module modules/mod_foo.so
#
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_basic_module modules/mod_auth_basic.so
#LoadModule auth_digest_module modules/mod_auth_digest.so
#LoadModule authn_anon_module modules/mod_authn_anon.so
#LoadModule authn_dbm_module modules/mod_authn_dbm.so
LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authn_file_module modules/mod_authn_file.so
#LoadModule authz_dbm_module modules/mod_authz_dbm.so
LoadModule authz_default_module modules/mod_authz_default.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
#LoadModule cern_meta_module modules/mod_cern_meta.so
LoadModule cgi_module modules/mod_cgi.so
#LoadModule dav_module modules/mod_dav.so
#LoadModule dav_fs_module modules/mod_dav_fs.so
#LoadModule deflate_module modules/mod_deflate.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
#LoadModule expires_module modules/mod_expires.so
#LoadModule file_cache_module modules/mod_file_cache.so
#LoadModule headers_module modules/mod_headers.so
LoadModule imagemap_module modules/mod_imagemap.so
LoadModule include_module modules/mod_include.so
#LoadModule info_module modules/mod_info.so
LoadModule isapi_module modules/mod_isapi.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
#LoadModule mime_magic_module modules/mod_mime_magic.so
#LoadModule proxy_module modules/mod_proxy.so
#LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
#LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
#LoadModule proxy_connect_module modules/mod_proxy_connect.so
#LoadModule proxy_http_module modules/mod_proxy_http.so
#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule negotiation_module modules/mod_negotiation.so
#LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
#LoadModule speling_module modules/mod_speling.so
#LoadModule status_module modules/mod_status.so
#LoadModule unique_id_module modules/mod_unique_id.so
LoadModule userdir_module modules/mod_userdir.so
#LoadModule usertrack_module modules/mod_usertrack.so
#LoadModule vhost_alias_module modules/mod_vhost_alias.so
#LoadModule ssl_module modules/mod_ssl.so

# 'Main' server configuration
#
# The directives in this section set up the values used by the 'main'
# server, which responds to any requests that aren't handled by a
# <VirtualHost> definition. These values also provide defaults for
# any <VirtualHost> containers you may define later in the file.
#
# All of these directives may appear inside <VirtualHost> containers,
# in which case these default settings will be overridden for the
# virtual host being defined.
#

#
# ServerAdmin: Your address, where problems with the server should be
# e-mailed. This address appears on some server-generated pages, such
# as error documents. e.g. [email protected]
#
ServerAdmin [email protected]

#
# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
#
ServerName localhost:80

#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs"

#
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#
# First, we configure the "default" to be a very restrictive set of
# features.
#
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Satisfy all
</Directory>

#
# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.
#

#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None

#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all

</Directory>

#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>

#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<FilesMatch "^\.ht">
Order allow,deny
Deny from all
</FilesMatch>

#
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here. If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog logs/error.log

#
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel warn

<IfModule log_config_module>
#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
#
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common

<IfModule logio_module>
# You need to enable mod_logio.c to use %I and %O
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>

#
# The location and format of the access logfile (Common Logfile Format).
# If you do not define any access logfiles within a <VirtualHost>
# container, they will be logged here. Contrariwise, if you *do*
# define per-<VirtualHost> access logfiles, transactions will be
# logged therein and *not* in this file.
#
  #3 (permalink)  
Antiguo 09/01/2007, 14:44
Avatar de sumolari  
Fecha de Ingreso: mayo-2006
Ubicación: localhost
Mensajes: 1.367
Antigüedad: 18 años
Puntos: 18
Re: Error al abrir un archivo php

Cita:
CustomLog logs/access.log common

#
# If you prefer a logfile with access, agent, and referer information
# (Combined Logfile Format) you can use the following directive.
#
#CustomLog logs/access.log combined
</IfModule>
<IfModule alias_module>
#
# Redirect: Allows you to tell clients about documents that used to
# exist in your server's namespace, but do not anymore. The client
# will make a new request for the document at its new location.
# Example:
# Redirect permanent /foo http://localhost/bar

#
# Alias: Maps web paths into filesystem paths and is used to
# access content that does not live under the DocumentRoot.
# Example:
# Alias /webpath /full/filesystem/path
#
# If you include a trailing / on /webpath then the server will
# require it to be present in the URL. You will also likely
# need to provide a <Directory> section to allow access to
# the filesystem path.

#
# ScriptAlias: This controls which directories contain server scripts.
# ScriptAliases are essentially the same as Aliases, except that
# documents in the target directory are treated as applications and
# run by the server when requested rather than as documents sent to the
# client. The same rules about trailing "/" apply to ScriptAlias
# directives as to Alias.
#
ScriptAlias /cgi-bin/ "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/"

</IfModule>

#
# "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>

#
# Apache parses all CGI scripts for the shebang line by default.
# This comment line, the first line of the script, consists of the symbols
# pound (#) and exclamation (!) followed by the path of the program that
# can execute this specific script. For a perl script, with perl.exe in
# the C:\Program Files\Perl directory, the shebang line should be:

#!c:/program files/perl/perl

# Note you _must_not_ indent the actual shebang line, and it must be the
# first line of the file. Of course, CGI processing must be enabled by
# the appropriate ScriptAlias or Options ExecCGI directives for the files
# or directory in question.
#
# However, Apache on Windows allows either the Unix behavior above, or can
# use the Registry to match files by extention. The command to execute
# a file of this type is retrieved from the registry by the same method as
# the Windows Explorer would use to handle double-clicking on a file.
# These script actions can be configured from the Windows Explorer View menu,
# 'Folder Options', and reviewing the 'File Types' tab. Clicking the Edit
# button allows you to modify the Actions, of which Apache 1.3 attempts to
# perform the 'Open' Action, and failing that it will try the shebang line.
# This behavior is subject to change in Apache release 2.0.
#
# Each mechanism has it's own specific security weaknesses, from the means
# to run a program you didn't intend the website owner to invoke, and the
# best method is a matter of great debate.
#
# To enable the this Windows specific behavior (and therefore -disable- the
# equivilant Unix behavior), uncomment the following directive:
#
#ScriptInterpreterSource registry
#
# The directive above can be placed in individual <Directory> blocks or the
# .htaccess file, with either the 'registry' (Windows behavior) or 'script'
# (Unix behavior) option, and will override this server default option.
#

#
# DefaultType: the default MIME type the server will use for a document
# if it cannot otherwise determine one, such as from filename extensions.
# If your server contains mostly text or HTML documents, "text/plain" is
# a good value. If most of your content is binary, such as applications
# or images, you may want to use "application/octet-stream" instead to
# keep browsers from trying to display binary files as though they are
# text.
#
DefaultType text/plain

<IfModule mime_module>
#
# TypesConfig points to the file containing the list of mappings from
# filename extension to MIME-type.
#
TypesConfig conf/mime.types

#
# AddType allows you to add to or override the MIME configuration
# file specified in TypesConfig for specific file types.
#
#AddType application/x-gzip .tgz
#
# AddEncoding allows you to have certain browsers uncompress
# information on the fly. Note: Not all browsers support this.
#
#AddEncoding x-compress .Z
#AddEncoding x-gzip .gz .tgz
#
# If the AddEncoding directives above are commented-out, then you
# probably should define those extensions to indicate media types:
#
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz



ScriptAlias /php/ "c:/PHP/ "
AddType application/x-httpd-php .php .php5
Action application/x-httpd-php "/php/php-cgi.exe"





#
# AddHandler allows you to map certain file extensions to "handlers":
# actions unrelated to filetype. These can be either built into the server
# or added with the Action directive (see below)
#
# To use CGI scripts outside of ScriptAliased directories:
# (You will also need to add "ExecCGI" to the "Options" directive.)
#
#AddHandler cgi-script .cgi

# For type maps (negotiated resources):
#AddHandler type-map var

#
# Filters allow you to process content before it is sent to the client.
#
# To parse .shtml files for server-side includes (SSI):
# (You will also need to add "Includes" to the "Options" directive.)
#
#AddType text/html .shtml
#AddOutputFilter INCLUDES .shtml
</IfModule>

#
# The mod_mime_magic module allows the server to use various hints from the
# contents of the file itself to determine its type. The MIMEMagicFile
# directive tells the module where the hint definitions are located.
#
#MIMEMagicFile conf/magic

#
# Customizable error responses come in three flavors:
# 1) plain text 2) local redirects 3) external redirects
#
# Some examples:
#ErrorDocument 500 "The server made a boo boo."
#ErrorDocument 404 /missing.html
#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
#ErrorDocument 402 http://localhost/subscription_info.html
#

#
# EnableMMAP and EnableSendfile: On systems that support it,
# memory-mapping or the sendfile syscall is used to deliver
# files. This usually improves server performance, but must
# be turned off when serving from networked-mounted
# filesystems or if support for these functions is otherwise
# broken on your system.
#
#EnableMMAP off
#EnableSendfile off

# Supplemental configuration
#
# The configuration files in the conf/extra/ directory can be
# included to add extra features or to modify the default configuration of
# the server, or you may simply copy their contents here and change as
# necessary.

# Server-pool management (MPM specific)
#Include conf/extra/httpd-mpm.conf

# Multi-language error messages
#Include conf/extra/httpd-multilang-errordoc.conf

# Fancy directory listings
#Include conf/extra/httpd-autoindex.conf

# Language settings
#Include conf/extra/httpd-languages.conf

# User home directories
#Include conf/extra/httpd-userdir.conf

# Real-time info on requests and configuration
#Include conf/extra/httpd-info.conf

# Virtual hosts
#Include conf/extra/httpd-vhosts.conf

# Local access to the Apache HTTP Server Manual
#Include conf/extra/httpd-manual.conf

# Distributed authoring and versioning (WebDAV)
#Include conf/extra/httpd-dav.conf

# Various default settings
#Include conf/extra/httpd-default.conf

# Secure (SSL/TLS) connections
#Include conf/extra/httpd-ssl.conf
#
# Note: The following must must be present to support
# starting without SSL on platforms with no /dev/random equivalent
# but a statically compiled-in mod_ssl.
#
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
  #4 (permalink)  
Antiguo 09/01/2007, 14:55
Avatar de ferny
Il capo della mafia
 
Fecha de Ingreso: febrero-2002
Ubicación: Al final del cable
Mensajes: 10.080
Antigüedad: 22 años, 2 meses
Puntos: 55
Re: Error al abrir un archivo php

No veo en tu httpd.conf que hayas cargado el módulo de php, por eso php no puede funcionar Además, con la serie 2.2 de Apache tan sólo funciona "de serie" la versión 5.2 de PHP. Para otras versiones hay que bajarse una .dll compatible desde la web de apachelounge.

Te recomiendo olvidar el libro ya que no parece estar actualizado, y revisa en su lugar este manual: http://servidor.hostrocket.com En ese manual no se explica la configuración para apache 2.2 pero es muy parecida a la de apache 2.0 y no creo que te sea difícil seguirla, de todas formas si tienes alguna duda me la preguntas por aquí.

En cuanto a la .dll, en ese manual verás que hay que cargar el módulo de php que es un archivo php4apache2.dll (en el caso de php4 sobre apache 2) o php5apache2.dll (en el caso de php5 sobre apache 2). Tienes estas opciones:

- Si te descargas PHP 5.2, en éste viene la .dll ya preparada, y se llama php5apache2_2.dll
- Si te descargas otra versión de PHP, tienes que buscar la .dll en http://www.apachelounge.com/download/

Esta .dll es la que carga el módulo de apache en la sentencia LoadModule que podrás ver al seguir el tutorial.

Suerte
__________________
www.mundodivx.com || www.mundodivx.org

Pon tu mano en un horno caliente durante un minuto y te parecerá una hora.
Siéntate junto a una chica preciosa durante una hora y te parecerá un minuto.
Eso es la relatividad.
  #5 (permalink)  
Antiguo 10/01/2007, 14:16
Avatar de sumolari  
Fecha de Ingreso: mayo-2006
Ubicación: localhost
Mensajes: 1.367
Antigüedad: 18 años
Puntos: 18
De acuerdo Muy bueno el tutorial

El tutorial está muy bien ... gracias. Pero hay una cosa que no entiendo,

Cita:
Procedemos a descargar el PHP para Windows. El archivo está localizado en la sección Downloads, apartado Windows Binaries, y es el "zip package" (no el "installer", aunque éste ocupe menos luego no nos servirá). Para la versión 4.4.4, que es la versión disponible a fecha de actualización de este manual, es: PHP 4.4.4 zip package [8,090Kb] . Según vayan saliendo nuevas versiones podrás irlas encontrando en la citada sección downloads.

Una vez descargado todo el ZIP, nos creamos una carpeta en el sitio donde queramos instalar los archivos del servidor (PHP, MySQL...), por ejemplo nos creamos una carpeta en la raíz del disco duro y que quede así: C:\Servidor\ Ahora extraemos los archivos del ZIP de PHP dendro de esa carpeta. En este caso se crea la carpeta C:\Servidor\php-4.4.4-Win32\ pero como no nos gusta su nombre procedemos a renombrarla a C:\Servidor\PHP\

Y ahora hay que coger el php4ts.dll (localizado en C:\Servidor\PHP\php4ts.dll) y copiarlo al directorio System (en Windows 9x) o System32 (NT,2000,XP,2003) de la carpeta del Windows. Si hay otro archivo en System o System32 lo sobreescribimos. Igualmente coger los archivos que están en la carpeta C:\Servidor\PHP\dlls\ y copiarlos a la carpeta System o System32 igual que hicimos con el archivo php4ts.dll
¿Para qué hay que copiarlos a System32?

Otra cosa, aparte de ese pase lo he hecho lo demás, pero al modificar el archivo httpd.conf e iniciar Apache me aparece una ventanita diciendo que no se puede iniciar. Si quito los cambios y vuelvo a guardar ya me deja. He mirad a ver si es que he escrito algo mal, pero lo he escrito como decía el tutorial...

Gracias por la ayuda
  #6 (permalink)  
Antiguo 10/01/2007, 15:13
Avatar de ferny
Il capo della mafia
 
Fecha de Ingreso: febrero-2002
Ubicación: Al final del cable
Mensajes: 10.080
Antigüedad: 22 años, 2 meses
Puntos: 55
Re: Error al abrir un archivo php

Supongo que tendrá que ver con el path del sistema, el directorio system32 está en el path pero el de php no, así el sistema puede encontrar los .dll automáticamente. Quizá no sea necesario, ahora mismo no lo sé, pero si los copias seguro que no pasa nada

¿Hiciste lo del cambio del archivo .dll para apache? ¿Lo bajaste de apachelounge? Se me olvidó comentar que también hay que copiar otro fichero. Te voy a copiar aquí un post que hice hace meses con los cambios que hay que hacer para usar apache 2.2.X con una versión de PHP anterior a la 5.2. La explicación está hecha suponiendo que vamos a instalar php5 pero imagino que será similar si se trata de php4

Por lo demás, te recomiendo que uses php 5.2 ya que php4 dentro de no mucho quedará sin soporte (imagino que cuando se lance php6)
__________________
www.mundodivx.com || www.mundodivx.org

Pon tu mano en un horno caliente durante un minuto y te parecerá una hora.
Siéntate junto a una chica preciosa durante una hora y te parecerá un minuto.
Eso es la relatividad.
  #7 (permalink)  
Antiguo 10/01/2007, 15:14
Avatar de ferny
Il capo della mafia
 
Fecha de Ingreso: febrero-2002
Ubicación: Al final del cable
Mensajes: 10.080
Antigüedad: 22 años, 2 meses
Puntos: 55
Re: Error al abrir un archivo php

Instalación de Apache 2.2

Algunos me habéis preguntado por qué no funcionaba vuestro servidor al instalar Apache 2.2 con PHP5, y la respuesta que os daba es que el módulo php5apache2.dll todavía no es compatible con la versión 2.2 de Apache.

Bien, al parecer el motivo es que cambia ligeramente la API de Apache 2.2 frente a la de Apache 2.0, con lo cual son incompatibles. Sin embargo, existe la posibilidad de hacerlo funcionar si nos bajamos el archivo .dll ya configurado para Apache 2.2 y no para Apache 2.0. Este archivo vendrá ya incluido cuando salga la versión 5.2.0 de PHP y se llamará php5apache2_2.dll, pero hasta que salga, podéis descargar una versión del php5apache2.dll preparada para Apache 2.2 desde http://www.apachelounge.com/download/

Se distribuye en un ZIP que contiene tres ficheros, un TXT con la ayuda para la instalación, y dos ficheros más que debemos copiar a ciertos directorios:
- Copiar php5apache2.dll al directorio de PHP (ej. C:/Servidor/php), sustituyendo el ya existente.
- Copiar httpd.exe.manifest al directorio apache2.2/bin

Más información: http://bugs.php.net/bug.php?id=37338

------------------------------------------------

¿Qué cambia en la instalación / configuración de Apache 2.2 frente a Apache 2.0?

Por suerte, prácticamente nada. La instalación es igual y la configuración prácticamente igual. Vemos los cambios en la configuración:
  1. Configuración del DirectoryIndex

    En Apache 2.0, al buscar DirectoryIndex en el httpd.conf para realizar su configuración, nos salía esto:
    Código:
     #
    # DirectoryIndex: sets the file that Apache will serve if a directory
    # is requested.
    #
    # The index.html.var file (a type-map) is used to deliver content-
    # negotiated documents. The MultiViews Option can be used for the
    # same purpose, but it is much slower.
    #
    DirectoryIndex index.html index.html.var
    
    Ahora nos saldrá esto:
    Código:
    #
    # DirectoryIndex: sets the file that Apache will serve if a directory
    # is requested.
    #
    <IfModule dir_module>
        DirectoryIndex index.html
    </IfModule>
    
    Pero los cambios que hay que realizar son los mismos.

  2. Seguridad de los directorios

    En Apache 2.0, por defecto deja a cualquier usuario ver cualquier directorio del servidor, con lo cual no tenemos que cambiar nada, pero en esta versión 2.2 viene configurado para que no se puedan ver los directorios, con lo cual si instalamos nuestro servidor y lo ponemos a funcionar, resulta que nos da un error de acceso prohibido cuando queremos ver alguna página.

    Para solucionarlo, buscamos esto en el httpd.conf:
    Código:
    <Directory />
        Options FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Satisfy all
    </Directory>
    
    Y simplemente sustituimos Deny from all por Allow from all, de forma que quede así:
    Código:
    <Directory />
        Options FollowSymLinks
        AllowOverride None
        Order deny,allow
        Allow from all
        Satisfy all
    </Directory>
    
  3. VirtualHosts

    Si vamos a crear algún VirtualHost, cambia la forma de realizarlo. En el fichero httpd.conf, nos vamos casi al final, y localizamos lo siguiente:
    Código:
    # Virtual hosts
    #Include conf/extra/httpd-vhosts.conf
    
    Debemos quitar el # de la segunda de las líneas, para que quede así:
    Código:
    # Virtual hosts
    Include conf/extra/httpd-vhosts.conf
    
    Ahora abrimos ese fichero, que como puedes ver está en apache2.2/conf/extra/httpd-vhosts.conf, y en él metemos la configuración de nuestros virtualhosts, que es la misma que podéis ver en el manual actualizado.

Espero que os sirva para hacer funcionar Apache 2.2, a mi me ha funcionado

Un saludo
__________________
www.mundodivx.com || www.mundodivx.org

Pon tu mano en un horno caliente durante un minuto y te parecerá una hora.
Siéntate junto a una chica preciosa durante una hora y te parecerá un minuto.
Eso es la relatividad.
  #8 (permalink)  
Antiguo 11/01/2007, 08:10
Avatar de sumolari  
Fecha de Ingreso: mayo-2006
Ubicación: localhost
Mensajes: 1.367
Antigüedad: 18 años
Puntos: 18
Re: Error al abrir un archivo php

Cita:
Iniciado por ferny Ver Mensaje

Por lo demás, te recomiendo que uses php 5.2 ya que php4 dentro de no mucho quedará sin soporte (imagino que cuando se lance php6)
El problema es que por error le di a la opción de bloquear la conexión de php 5.2 del Norton Antivirus 2005, y no sé como quitarlo. Cuando saquen el php 6 lo actualizaré.

Lo hice todo menos lo de copiar los archivos a system32.

Pero es que mira, si quito el httpd.conf lo del módulo de php4 que dice el tutorial ya me arranca el servidor, el php no pero al menosel servidor...
  #9 (permalink)  
Antiguo 11/01/2007, 08:29
Avatar de ferny
Il capo della mafia
 
Fecha de Ingreso: febrero-2002
Ubicación: Al final del cable
Mensajes: 10.080
Antigüedad: 22 años, 2 meses
Puntos: 55
Re: Error al abrir un archivo php

Perdona si insisto pero es que el error de que no se puede iniciar si pones php sucede si algo de lo que he puesto en el anterior post no se hace bien... por eso creo que sigue habiendo algún error en la configuración.

Cita:
- Copiar php5apache2.dll al directorio de PHP (ej. C:/Servidor/php), sustituyendo el ya existente.
- Copiar httpd.exe.manifest al directorio apache2.2/bin
¿Hiciste eso? Si estás instalando php4 entonces la .dll que tienes que bajar y sustituir se llama php4apache2.dll, lo anterior como dije es un ejemplo para php5. Es este el que debes bajar: http://www.apachelounge.com/download...l-php4.4.x.zip

Si ves que no... bájate e instala apache 2.0.59 que con éste seguro que no te da problemas.

__________________
www.mundodivx.com || www.mundodivx.org

Pon tu mano en un horno caliente durante un minuto y te parecerá una hora.
Siéntate junto a una chica preciosa durante una hora y te parecerá un minuto.
Eso es la relatividad.
  #10 (permalink)  
Antiguo 11/01/2007, 08:30
Avatar de ferny
Il capo della mafia
 
Fecha de Ingreso: febrero-2002
Ubicación: Al final del cable
Mensajes: 10.080
Antigüedad: 22 años, 2 meses
Puntos: 55
Re: Error al abrir un archivo php

Perdona se me ha olvidado algo, tienes que tener también instalado el .NET Framework 2, es una actualización de windows xp que puedes encontrar en windows update. Creo que sólo es necesaria si usas la .dll de apachelounge.

Te recomiendo que hagas lo imposible para desbloquear la descarga de php 5.2, incluso si me dices tu correo (mándame un mensaje privado) te lo envío ahora mismo...
__________________
www.mundodivx.com || www.mundodivx.org

Pon tu mano en un horno caliente durante un minuto y te parecerá una hora.
Siéntate junto a una chica preciosa durante una hora y te parecerá un minuto.
Eso es la relatividad.
  #11 (permalink)  
Antiguo 11/01/2007, 13:21
Avatar de sumolari  
Fecha de Ingreso: mayo-2006
Ubicación: localhost
Mensajes: 1.367
Antigüedad: 18 años
Puntos: 18
Re: Error al abrir un archivo php

Ya he recibido el email
  #12 (permalink)  
Antiguo 11/01/2007, 14:07
Avatar de sumolari  
Fecha de Ingreso: mayo-2006
Ubicación: localhost
Mensajes: 1.367
Antigüedad: 18 años
Puntos: 18
Re: Error al abrir un archivo php

No hay manera... creo que lo intentaré de nuevo cuando saquen php 6...
  #13 (permalink)  
Antiguo 11/01/2007, 14:45
Avatar de ferny
Il capo della mafia
 
Fecha de Ingreso: febrero-2002
Ubicación: Al final del cable
Mensajes: 10.080
Antigüedad: 22 años, 2 meses
Puntos: 55
Re: Error al abrir un archivo php

Mira te paso mi archivo httpd.conf para que lo compares con el tuyo. Las rutas de instalación que tengo son:

Apache -> C:\Servidor\Apache2.2
PHP 5.2 -> C:\Servidor\PHP
Archivos Adjuntos
Tipo de Archivo: zip httpd.zip (6,4 KB (Kilobytes), 13 visitas)
__________________
www.mundodivx.com || www.mundodivx.org

Pon tu mano en un horno caliente durante un minuto y te parecerá una hora.
Siéntate junto a una chica preciosa durante una hora y te parecerá un minuto.
Eso es la relatividad.
  #14 (permalink)  
Antiguo 27/02/2007, 12:35
Avatar de sumolari  
Fecha de Ingreso: mayo-2006
Ubicación: localhost
Mensajes: 1.367
Antigüedad: 18 años
Puntos: 18
Re: Error al abrir un archivo php

Bueno, tuve unos problemas con el ordenador y no tuvo otro remedio que fomatear, ahora he vuelto a probar a instalar php y apache y vuelvo a tener el mismo problema, pero esta vez no me da error al iniciar apache, sino al abrir un archivo .php, me dice que no sabe como interpretarlo, instalé php desde el .zip que hay en php.net, voy a ver si lo pued instalar con el instalador "normal" (por decir algo), gracias pro tu ayuda Ferny.
Saludos
  #15 (permalink)  
Antiguo 27/02/2007, 17:31
Avatar de nadie_ats  
Fecha de Ingreso: abril-2005
Ubicación: Barcelona (catalunya)
Mensajes: 818
Antigüedad: 19 años
Puntos: 8
Re: Error al abrir un archivo php

Y porque no pruebas en instalar XAMMP , por ejemplo , y lo modificas a tu gusto ?
Si yo que se configurar Apache lo hago asi es porque te evitas trabajo , luego lo modificas a tu gusto y ya esta .
__________________
Intentando recordar todos los conocimientos que olvide .
  #16 (permalink)  
Antiguo 28/02/2007, 00:22
Avatar de sumolari  
Fecha de Ingreso: mayo-2006
Ubicación: localhost
Mensajes: 1.367
Antigüedad: 18 años
Puntos: 18
Re: Error al abrir un archivo php

Pues porque no sé que es XAMMP, perobuscaré por google y cuando sepa algo de él veré a ver si lo uso.

Gracias, saludos
  #17 (permalink)  
Antiguo 28/02/2007, 01:54
Avatar de nadie_ats  
Fecha de Ingreso: abril-2005
Ubicación: Barcelona (catalunya)
Mensajes: 818
Antigüedad: 19 años
Puntos: 8
Re: Error al abrir un archivo php

es apache +php+mysql +servidor ftp + mercury mail +phpmyadmin y unas cuantas cosas mas .
__________________
Intentando recordar todos los conocimientos que olvide .
  #18 (permalink)  
Antiguo 28/02/2007, 07:04
Avatar de sumolari  
Fecha de Ingreso: mayo-2006
Ubicación: localhost
Mensajes: 1.367
Antigüedad: 18 años
Puntos: 18
Re: Error al abrir un archivo php

Si, después de buscar por google y leer por ahí ya sé que es, ahora lo estoy intalando, ya contaré cmo me va...

Gracias
  #19 (permalink)  
Antiguo 28/02/2007, 07:31
Avatar de sumolari  
Fecha de Ingreso: mayo-2006
Ubicación: localhost
Mensajes: 1.367
Antigüedad: 18 años
Puntos: 18
Re: Error al abrir un archivo php

pues nada, sigo sin poder hacerlo, ahora voy a probar con appservrnetwork
  #20 (permalink)  
Antiguo 01/03/2007, 06:40
Avatar de nadie_ats  
Fecha de Ingreso: abril-2005
Ubicación: Barcelona (catalunya)
Mensajes: 818
Antigüedad: 19 años
Puntos: 8
Re: Error al abrir un archivo php

creo que tu problema es que te bloquea al php el antivirus o antispy
__________________
Intentando recordar todos los conocimientos que olvide .
  #21 (permalink)  
Antiguo 01/04/2007, 23:48
Avatar de sumolari  
Fecha de Ingreso: mayo-2006
Ubicación: localhost
Mensajes: 1.367
Antigüedad: 18 años
Puntos: 18
Re: Error al abrir un archivo php

bueno, leyendo un post por ahí he visto easy php, lo he probado y me va de maravilla. ¡muchas gracias :arriba!
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 15:23.