I have installed PHP5 into a recent Linux Ubuntu 12.04 installation (over a month ago), and have been working on trying to configure PHP and make it work, but have been unsuccessful. I have nearly always been able to figure out hardware and software problems, but am currently stumped and need some help. I have three PHP technical books I bought a couple of years ago, and I can find nothing in them to help me resolve this problem. There is urgency since I have a website (developed in HTML) that I need to add new features to with PHP. I have coded about 90% of it in PHP and tested it, but my Ubuntu 10.10 stopped working and there was no longer any support for that version. So I had to reinstall a current version of Linux Ubuntu, Apache, PHP, MySQL, and PHPAdmin (LAMP), and get them to work first.
I installed PHP with the ‘sudo apt-get install php5’ command at the Terminal Window. I got the following information from inserting ‘127.0.1.1/info.php’ in my browser address input space. That is the only PHP command that I can get to work. The version of PHP that was installed is 5.3.10; the localhost port is 127.0.1.1 (the default since the installation was unable to find a port designation); the Apache version is 2.2.22; my root directory is /var/www; my php.ini configuration file is at /etc/php5/apache2; additional .ini files are at /etc/php5/apache2/conf.d; the path is ‘/usr/local/bin; /usr/bin; /bin’. My browser is Firefox version 22.0 (the current and newest version).
When I double click on a .php file in Nautilus, the editor (gedit) is started, and shows the contents of the .php file, and the PHP commands are not executed (whereas they executed fine in my previous Ubuntu 10.10 installation). When I double click on a .html file that has PHP code in it, I get the output from the HTML commands, but no output from the PHP commands. When I right click on the browser output to view the Page Source, the HTML commands are in purple, and the PHP commands are in red (I think this indicates the PHP commands are not being executed). All of these worked fine in my previous Ubuntu 10.10 and PHP installation, so unless basic coding rules have changed drastically, it cannot be a HTML or PHP coding problem.
My /etc/apache2/httpd.conf file is as follows:
AddType application/x-compress .z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php .phtml .html
AddType application/x-httpd-php-source .phps
LoadModule access_module modules/mod_access.so
LoadModule actions_module /usr/lib/apache2/modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule asis_module /usr/lib/apache2/modules/mod_asis.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule ssl_module modules/mod_ssl.so
LoadModule php5_module modules/libphp5.so
My /etc/php5/apache2/php.ini file (without the commented lines) is as follows:
[PHP]
engine = On
short_open_tag = On
asp_tags = Off
precision = 14
y2k_compliance = On
output_buffering = 4096
zlib.output_compression = Off
zlib.output_compression = Off
implicit_flush = Off
unserialize_callback_func =
serialize_precision = 17
allow_call_time_pass_reference = Off
safe_mode = Off
safe_mode_gid = Off
safe_mode_include_dir =
safe_mode_exec_dir =
safe_mode_allowed_env_vars = PHP_
safe_mode_protected_env_vars = LD_LIBRARY_PATH
disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
disable_classes =
zend.enable_gc = On
expose_php = On
max_execution_time = 30
max_input_time = 60
memory_limit = 128M
error_reporting = E_ALL & ~E_DEPRECATED
display_errors = Off
display_startup_errors = Off
log_errors = On
log_errors_max_len = 1024
ignore_repeated_errors = Off
ignore_repeated_source = Off
report_memleaks = On
track_errors = Off
html_errors = Off
variables_order = “GPCS”
request_order = “GP”
register_globals = Off
register_long_arrays = Off
register_argc_argv = Off
auto_globals_jit = On
post_max_size = 8M
magic_quotes_gpc = Off
magic_quotes_runtime = Off
magic_quotes_sybase = Off
auto_prepend_file =
auto_append_file =
default_mimetype = “text/html”
include_path = “.:/usr/bin/php5: /usr/share/php5: /usr/lib/php5: /var/lib/php5: /etc/php5”
doc_root =
user_dir =
enable_dl = Off
file_uploads = On
upload_max_filesize = 2M
max_file_uploads = 20
allow_url_fopen = On
allow_url_include = Off
default_socket_timeout = 60
[Date]
[filter]
[iconv]
[intl]
[sqlite]
[sqlite3]
[Pcre]
[Pdo]
[Pdo_mysql]
pdo_mysql.cache_size = 2000
pdo_mysql.default_socket=
[Phar]
[Syslog]
define_syslog_variables = Off
[mail function]
SMTP = localhost
smtp_port = 25
mail.add_x_header = On
[SQL]
sql.safe_mode = Off
[ODBC]
odbc.allow_persistent = On
odbc.check_persistent = On
odbc.max_persistent = -1
odbc.max_links = -1
odbc.defaultlrl = 4096
odbc.defaultbinmode = 1
[Interbase]
ibase.allow_persistent = 1
ibase.max_persistent = -1
ibase.max_links = -1
ibase.timestampformat = “%Y-%m-%d %H:%M:%S”
ibase.dateformat = “%Y-%m-%d”
ibase.timeformat = “%H:%M:%S”
[MySQL]
mysql.allow_local_infile = On
mysql.allow_persistent = On
mysql.cache_size = 2000
mysql.max_persistent = -1
mysql.max_links = -1
mysql.default_port =
mysql.default_socket =
mysql.default_host =
mysql.default_user =
mysql.default_password =
mysql.connect_timeout = 60
mysql.trace_mode = Off
[MySQLi]
mysqli.max_persistent = -1
mysqli.allow_persistent = On
mysqli.max_links = -1
mysqli.cache_size = 2000
mysqli.default_port = 3306
mysqli.default_socket =
mysqli.default_host =
mysqli.default_user =
mysqli.default_pw =
mysqli.reconnect = Off
[mysqlnd]
mysqlnd.collect_statistics = On
mysqlnd.collect_memory_statistics = Off
[OCI8]
[PostgreSQL]
pgsql.allow_persistent = On
pgsql.auto_reset_persistent = Off
pgsql.max_persistent = -1
pgsql.max_links = -1
pgsql.ignore_notice = 0
pgsql.log_notice = 0
[Sybase-CT]
sybct.allow_persistent = On
sybct.max_persistent = -1
sybct.max_links = -1
sybct.min_server_severity = 10
sybct.min_client_severity = 10
[bcmath]
bcmath.scale = 0
[browscap]
[Session]
session.save_handler = files
session.use_cookies = 1
session.use_only_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.cookie_httponly =
session.serialize_handler = php
session.gc_probability = 0
session.gc_divisor = 1000
session.gc_maxlifetime = 1440
session.bug_compat_42 = Off
session.bug_compat_warn = Off
session.referer_check =
session.entropy_length = 0
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0
session.hash_function = 0
session.hash_bits_per_character = 5
url_rewriter.tags = “a=href,area=href,frame=src,input=src,form=fakeentry”
[MSSQL]
mssql.allow_persistent = On
mssql.max_persistent = -1
mssql.max_links = -1
mssql.min_error_severity = 10
mssql.min_message_severity = 10
mssql.compatability_mode = Off
mssql.secure_connection = Off
[Assertion]
[COM]
[mbstring]
[gd]
[exif]
[Tidy]
tidy.clean_output = Off
[soap]
soap.wsdl_cache_enabled=1
soap.wsdl_cache_dir="/tmp"
soap.wsdl_cache_ttl=86400
soap.wsdl_cache_limit = 5
[sysvshm]
[ldap]
ldap.max_links = -1
[mcrypt]
[dba]
[xsl]
I have downloaded the PHP manual, and read the Configuration section, and have found nothing helpful there. In addition, the PHP manual is outdated, and is primarily about PHP4, and many things in PHP5 seem to have changed since PHP4. The only other clue I have is from the /var/log/apache2/error.log file, and I have been unable to interpret the meaning of the error messages in it. They are as follows:
[Sun Jun 23 18:32:36 2013] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico
[Sun Jun 23 18:41:35 2013] [error] [client 192.168.210.100] File does not exist: /var/www/currentsetting.htm
A confusing aspect of this for me is that the port address in the second error message is shown as 192.168.210.100 instead of 127.0.1.1. I have spent a lot of time searching with grep for a file with ‘currentsetting.htm’ in it to see where this comes from, but have been unable to find it. The first error message has the default port address in it. And to me, this begs the question, why won’t this work when you install PHP without all of this hassle? I’m beginning to think that even though I have invested a lot of time developing several vitally needed features using PHP in my website, perhaps I should move on to other software to complete this. I feel quite exasperated and frustrated by this experience. I hope at least one of you has the knowledge, experience, and competence to help me resolve this problem soon so I don’t have to start over with something else. Thanks.