PHP - Needing Php 4.20 Files Translated To Php 5.38 For Apache 2.2.17
Hello, helpful readers:
You all have been great for me in the past.... How do I handled index.php file unable to print the header.php or footer.php, for instance because of the version conflict. Have transferred all files from Yahoo, to Apache 2.2.17 web server. Everything else is taking shape nicely, thanks largely to the advice received here. Thanks for any info, Yshua Similar TutorialsPlease bear with me in the following exercise. I'm fairly new to php (but not coding) and am trying to push my skills for the future, so I'm going beyond a problem for which I already have a solution to see if I understand the coding principles correctly. I am trying to understand just how far I can push the ternary operator shorthand. I know how to do simple tasks, but I'm wondering if I can perform more than one command in the same statement? I'm a little confused because I'd like to both set a session variable and do a page redirect and I have a feeling that the order of these operations matters, so all I've done here may be incorrect. I have a form on the front page of my site that includes a checkbox that is required in order to enter the site. The form action goes to a page where this is checked, a $_SESSION variable is set, and the page is redirected. I am also not sure if I need the session_write_close(); command, or if it is in the right place. In the full length version, it could be moved into the set of commands following the IF. Here is the full length code that I would like to translate into shorthand: Code: [Select] <?php session_start(); if (isset($_POST['ConsentCheckbox']) { $_SESSION['Consented'] = 'true'; header('Location: http://www.mySite/welcome'); } else { header('Location: http://www.mySite/errors/NotConsented'); } session_write_close(); ?> The if/else conditions translate easily into these two lines of code, which could be one line if I didn't also need to set the session variable: Code: [Select] <?php session_start(); $_SESSION['Consented'] = isset($_POST['ConsentCheckbox']) ? 'true' : 'false'; header('Location: http://mySite.com/'.($_SESSION['Consented'] ? 'welcome' : 'error/NotConsented')); session_write_close(); ?> But, I really only need to set the $_SESSION variable if the $_POST['ConsentCheckbox'] is set. This makes the test on the following pages of my site much simpler (where I test to see if the $_SESSION variable is set and then either redirect to the consent form or load the desired page). SO, I'm wondering if it can be further condensed. I've come up with these possibilities, but am not totally sure. This has now become a theoretical exercise in coding for me. Here is what I think is possible, but I have a couple of outstanding questions, so I'd like some input, please. I first translated it into the following. I think this is correct, although I'm not sure if I need brackets around the multiple commands in the TRUE section. Code: [Select] <?php session_start(); isset($_POST['ConsentCheckbox']) ? $_SESSION['Consented']='true'; header('Location: http://www.mySite.com/welcome') : header('Location: http://www.mySite/errors/NotConsented'); session_write_close(); ?> Then, I wondered if I can even further condense it in the following way? Here is where the order of the commands is likely to break the code - and I'm not entirely sure that my use of double quotes will suffice instead of escaping out the end bracket of the header() command: Code: [Select] <?php session_start(); header('Location: http://www.mySite.com/'.(isset($_Post['ConsentCheckbox']) ? "welcome')"; $_SESSION['Consented'] = 'true' : "errors/NotConsented')"); session_write_close(); ?> Have I gone too far? Thanks So ive created a script sometime back for entering movies into my database, i simply fill in the movie title, URL for it and then from a drop down menu i select what category from the catagories table that it fits in. eventually after time some of the movies need to be placed in a different category. currently the only way to do this is actually go into myphpadmin and edit within the tables. obviously way too time consuming. so im seeking to create a script that would allow me to select any given movie from my movies table (via dropdown maybe) and then change what category its assigned too, maybe also in a dropdown. heres the table structure. Movies Table ID - Title - Category - URL ---------------------------------------------------- 1 - Movie 1 - 18 www..com Categories Table ID - Category Name -------------------------------- 18 - Category 1 Note that the FK in movies table is Category. in my previous script from entering the movies i have it made so that when selecting the category it shows the category name instead of the ID. i hope that the same could be possible for this new script. If its not too much trouble i hope that someone could help me out on this. im totally clueless where too start. thanks! Hi guys! I'm new to PHP and I need help from you to create a simple form with checkboxes. Experts here will be able to solve it easily. I'm posting a part of the code below. form.html Code: [Select] Interests<br /> Sports<input type="checkbox" name="interests[]" value="Sports" /> <br /> Reading<input type="checkbox" name="interests[]" value="Reading" /> <br /> Surfing<input type="checkbox" name="interests[]" value="Surfing" /> <br /> output.php Code: [Select] <?php $inter = $_POST['interests']; ?> I read somewhere that it is now submitted as an array to to the output.php file but I don't know how to play with it.I want php to out put the values of $inter in the following manner. "You are interested in {$inter}." Please help me. Is this a very complicated code to write? Hello, I have checked out many of the scripts and tried implementing them to help me scrape 1 single image from a url. Example www.123.com/333.png Getting a script to scrape that image isnt the problem. Im not sure on how to implement the simple curl to save the image every 30mins and name it in successive order so it appears as , 1.jpg, 2.jpg, 3.jpg I am working with a debian 6 server and php would be the easiest way to do this that i can work with. I have searched the web endlessly and still cant produce such thing. Any help is appreciated. So far, my company has been using Apache (Linux)-based web hosts for our hosting needs. Ever since the Heartbleed bug was found in OpenSSL, which is common to open source software, including Apache HTTP Server, I was wondering if Microsoft's IIS was any more secure than Apache. Opinions?
My arguement is that although IIS is a closed-source system, it is also a widely targeted platform (Windows) so that may be of concern. My argument for Apache is that it is open source, so exploits can be implemented using the source code as well, which is available for free download.
So, the question really is which HTTP server platform is more secure?
So im trying to use a script to fetch the weather forecast from weatherunderground and im using their weather API functionality. Basically im trying to get the output to be something like (Continuing down in a list) (Day of week): (Current conditions) (High temp)-(Low temp) this is what I have: Code: [Select] #!/usr/bin/php <?php $json_string = file_get_contents("http://api.wunderground.com/api/MY_APIKEY/forecast/q/19104.json"); $parsed_json = json_decode($json_string); $day = $parsed_json->{'forecast'}->{'simpleforecast'}->{'forecastday'}->{'date'}->{'weekday_short'}; $high = $parsed_json->{'forecast'}->{'simpleforecast'}->{'forecastday'}->{'high'}->{'fahrenheit'}; $low = $parsed_json->{'forecast'}->{'simpleforecast'}->{'forecastday'}->{'low'}->{'fahrenheit'}; $conditions = $parsed_json->{'forecast'}->{'simpleforecast'}->{'forecastday'}->{'conditions'}; echo "Forecast:\n"; echo "${day}: ${conditions} ${high}-${low}\n"; ?> the output of the get_file_contents is: Code: [Select] "response": { "version": "0.1", "termsofService": "http://www.wunderground.com/weather/api/d/terms.html", "features": { "forecast": 1 } }, "forecast": { "txt_forecast": {}, "simpleforecast": { "forecastday": [ { "date": { "epoch": "1330398000", "pretty": "10:00 PM EST on February 27, 2012", "day": 27, "month": 2, "year": 2012, "yday": 57, "hour": 22, "min": "00", "sec": 0, "isdst": "0", "monthname": "February", "weekday_short": "Mon", "weekday": "Monday", "ampm": "PM", "tz_short": "EST", "tz_long": "America/New_York" }, "period": 1, "high": { "fahrenheit": "59", "celsius": "15" }, "low": { "fahrenheit": "36", "celsius": "2" }, "conditions": "Partly Cloudy", "icon": "partlycloudy", "icon_url": "http://icons-ak.wxug.com/i/c/k/partlycloudy.gif", "skyicon": "mostlysunny", "pop": 0, "qpf_allday": { "in": 0, "mm": 0 }, "qpf_day": { "in": 0, "mm": 0 }, "qpf_night": { "in": 0, "mm": 0 }, "snow_allday": { "in": 0, "cm": 0 }, "snow_day": { "in": 0, "cm": 0 }, "snow_night": { "in": 0, "cm": 0 }, "maxwind": { "mph": 9, "kph": 14, "dir": "South", "degrees": 180 }, "avewind": { "mph": 6, "kph": 10, "dir": "South", "degrees": 171 }, "avehumidity": 65, "maxhumidity": 78, "minhumidity": 48 }, { "date": { "epoch": "1330484400", "pretty": "10:00 PM EST on February 28, 2012", "day": 28, "month": 2, "year": 2012, "yday": 58, "hour": 22, "min": "00", "sec": 0, "isdst": "0", "monthname": "February", "weekday_short": "Tue", "weekday": "Tuesday", "ampm": "PM", "tz_short": "EST", "tz_long": "America/New_York" }, "period": 2, "high": { "fahrenheit": "50", "celsius": "10" }, "low": { "fahrenheit": "37", "celsius": "3" }, "conditions": "Clear", "icon": "clear", "icon_url": "http://icons-ak.wxug.com/i/c/k/clear.gif", "skyicon": "mostlysunny", "pop": 0, "qpf_allday": { "in": 0, "mm": 0 }, "qpf_day": { "in": 0, "mm": 0 }, "qpf_night": { "in": 0, "mm": 0 }, "snow_allday": { "in": 0, "cm": 0 }, "snow_day": { "in": 0, "cm": 0 }, "snow_night": { "in": 0, "cm": 0 }, "maxwind": { "mph": 8, "kph": 13, "dir": "NW", "degrees": 318 }, "avewind": { "mph": 5, "kph": 8, "dir": "ESE", "degrees": 123 }, "avehumidity": 53, "maxhumidity": 69, "minhumidity": 39 }, { "date": { "epoch": "1330570800", "pretty": "10:00 PM EST on February 29, 2012", "day": 29, "month": 2, "year": 2012, "yday": 59, "hour": 22, "min": "00", "sec": 0, "isdst": "0", "monthname": "February", "weekday_short": "Wed", "weekday": "Wednesday", "ampm": "PM", "tz_short": "EST", "tz_long": "America/New_York" }, "period": 3, "high": { "fahrenheit": "43", "celsius": "6" }, "low": { "fahrenheit": "41", "celsius": "5" }, "conditions": "Rain", "icon": "rain", "icon_url": "http://icons-ak.wxug.com/i/c/k/rain.gif", "skyicon": "cloudy", "pop": 80, "qpf_allday": { "in": 0.71, "mm": 18 }, "qpf_day": { "in": 0.5, "mm": 12.7 }, "qpf_night": { "in": 0.21, "mm": 5.3 }, "snow_allday": { "in": 0, "cm": 0 }, "snow_day": { "in": 0, "cm": 0 }, "snow_night": { "in": 0, "cm": 0 }, "maxwind": { "mph": 16, "kph": 26, "dir": "ESE", "degrees": 106 }, "avewind": { "mph": 9, "kph": 14, "dir": "ESE", "degrees": 115 }, "avehumidity": 91, "maxhumidity": 95, "minhumidity": 64 }, { "date": { "epoch": "1330657200", "pretty": "10:00 PM EST on March 01, 2012", "day": 1, "month": 3, "year": 2012, "yday": 60, "hour": 22, "min": "00", "sec": 0, "isdst": "0", "monthname": "March", "weekday_short": "Thu", "weekday": "Thursday", "ampm": "PM", "tz_short": "EST", "tz_long": "America/New_York" }, "period": 4, "high": { "fahrenheit": "54", "celsius": "12" }, "low": { "fahrenheit": "32", "celsius": "0" }, "conditions": "Overcast", "icon": "cloudy", "icon_url": "http://icons-ak.wxug.com/i/c/k/cloudy.gif", "skyicon": "cloudy", "pop": 0, "qpf_allday": { "in": 0, "mm": 0 }, "qpf_day": { "in": 0, "mm": 0 }, "qpf_night": { "in": 0, "mm": 0 }, "snow_allday": { "in": 0, "cm": 0 }, "snow_day": { "in": 0, "cm": 0 }, "snow_night": { "in": 0, "cm": 0 }, "maxwind": { "mph": 10, "kph": 16, "dir": "WSW", "degrees": 253 }, "avewind": { "mph": 4, "kph": 6, "dir": "West", "degrees": 280 }, "avehumidity": 95, "maxhumidity": 100, "minhumidity": 87 } ] } } } I feel like i need to define different variables for each day like dayx, highx, lowx, conditionsx, etc where x=period and it increases the period every time you run through. I remember learning this in my intro to java class but in all honesty i forgot, even if i did know if i was on the right path. Any help? I'd appreciate it. Thanks -Koz Hi. I have our company website running on an older Joomla and so running PHP v5.6. We were encountering some issues so I have been rebuilding on latest Joomla version and will run the latest PHP now but I have encountered an issue (and I'm no php expert). We have a brochure page on the site where a user can select one or more brochures from a list, and then have to complete their details in a form and an email is sent to them with the brochures as a pdf attachment. We also receive an email notification with the user details and what brochure was selected so we can follow up on the lead. So I have the html coding for the web page, which links back to a php file with the brochures listed in an array and using phpmailer to send. Would someone be able to assist me by looking at the current files I have and showing me how to update the deprecated php commands - and also to ensure that the fields info is being properly verified etc. Thank you! hi i am calling some text from a database with php and echoing it to flash. i have no idea the charset anything is in. all i can see is that calling the text from the database and placing into flash yields in some missing chars, but if echo the called text to the browser, copy it and echo that to flash, all characters appear. now, i kow this is not a flash forum, and im not going to ask for a flash solution because there's just too many different charsets and code i cannot control/ nor see so i was thinking of doing something along the line of having php creating a clone of the copied text that appears in the browser, and having it echo that text to flash. it there something php can do, similar to what i described? regards Hi! I have a mysql database with a lot of emails there and I want to send an email to all the email addresses that are on my database.. There is like 7000 email addresses so could it be possible to set a interval time between each email sending? If it helps i'm using Linux / Debian 5 32bits Apache2 - php5 and php5-mysql hey guys i have apache installed but im sure my .htaccess file isnt being read...is there something in the config file i have to do please?...thank you I'm trying to run a process using shell_exec, however the program i'm trying to run must communicate with a process that is not a system process, and everytime i run it, it fails, does anyone know how to make a apache server run active windows not in the system process? Hi, I recently updraded PHP to 5.3.3 and Apache to 2.2.17 on a Linux Centos 5.4 Box using yum. Since then the Web pages running under Apache cannot connect to the database using mysql. If I run a manual PHP script, I am able to. When I run phpinfo() on PHP under Apache I get this (note: --without-mysql): './configure' '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--target=x86_64-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-libdir=lib64' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' '--disable-rpath' '--without-pear' '--with-bz2' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-xpm-dir=/usr' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--with-kerberos' '--enable-ucd-snmp-hack' '--enable-shmop' '--enable-calendar' '--without-mime-magic' '--without-sqlite' '--with-libxml-dir=/usr' '--enable-xml' '--with-system-tzdata' '--with-apxs2=/usr/sbin/apxs' '--without-mysql' '--without-gd' '--disable-dom' '--disable-dba' '--without-unixODBC' '--disable-pdo' '--disable-xmlreader' '--disable-xmlwriter' '--without-sqlite3' '--disable-phar' '--disable-fileinfo' '--disable-json' '--without-pspell' '--disable-wddx' '--without-curl' '--disable-posix' '--disable-sysvmsg' '--disable-sysvshm' '--disable-sysvsem' When I run phpinfo() on PHP that I run manually from the shell: ('--with-mysql=shared,/usr' '--with-mysqli=shared,/usr/bin/mysql_config') './configure' '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--target=x86_64-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-libdir=lib64' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' '--disable-rpath' '--without-pear' '--with-bz2' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-xpm-dir=/usr' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--with-kerberos' '--enable-ucd-snmp-hack' '--enable-shmop' '--enable-calendar' '--without-mime-magic' '--without-sqlite' '--without-sqlite3' '--with-libxml-dir=/usr' '--enable-xml' '--with-system-tzdata' '--enable-force-cgi-redirect' '--enable-pcntl' '--with-imap=shared' '--with-imap-ssl' '--enable-mbstring=shared' '--enable-mbregex' '--with-gd=shared' '--enable-bcmath=shared' '--enable-dba=shared' '--with-db4=/usr' '--with-xmlrpc=shared' '--with-ldap=shared' '--with-ldap-sasl' '--with-mysql=shared,/usr' '--with-mysqli=shared,/usr/bin/mysql_config' '--enable-dom=shared' '--with-pgsql=shared' '--enable-wddx=shared' '--with-snmp=shared,/usr' '--enable-soap=shared' '--with-xsl=shared,/usr' '--enable-xmlreader=shared' '--enable-xmlwriter=shared' '--with-curl=shared,/usr' '--enable-fastcgi' '--enable-pdo=shared' '--with-pdo-odbc=shared,unixODBC,/usr' '--with-pdo-mysql=shared,/usr' '--with-pdo-pgsql=shared,/usr' '--with-pdo-sqlite=shared,/usr' '--with-pdo-dblib=shared,/usr' '--enable-json=shared' '--enable-zip=shared' '--with-readline' '--with-pspell=shared' '--enable-phar=shared' '--with-mcrypt=shared,/usr' '--with-tidy=shared,/usr' '--with-mssql=shared,/usr' '--enable-sysvmsg=shared' '--enable-sysvshm=shared' '--enable-sysvsem=shared' '--enable-posix=shared' '--with-unixODBC=shared,/usr' '--enable-fileinfo=shared' '--enable-intl=shared' '--with-icu-dir=/usr' '--with-recode=shared,/usr' Both phpinfo() show PHP 5.3.3 how can I configure PHP under Apache? Do I need to rebuild / reintall Apache manually? Thanks very much! Frank Apache https setup!
Okay so i made my own SSL certificate for my localhost using these commands
OpenSSL: ( CMD > c:\xampp\apache\bin\openssl )
req -config c:\xampp\php\extras\ssl\openssl.cnf -new -out jobnow.csr -keyout jobnow.pem rsa -in jobnow.pem -out c:\jobnow.key x509 -in jobnow.csr -out jobnow.crt -req -signkey c:\jobnow.key -days 369when asked for common name type your ip address. Then i install import the certificate to certmgr.msc Restate Apache https//192.168.0.14 - Doesnt work 192.168.0.14 - Works fine Apache error log: [Wed Sep 10 12:05:41.299000 2014] [ssl:warn] [pid 7840:tid 260] AH01909: RSA certificate configured for localhost:80 does NOT include an ID which matches the server name [Wed Sep 10 12:05:41.301000 2014] [ssl:warn] [pid 7840:tid 260] AH01909: RSA certificate configured for 192.168.0.14:443 does NOT include an ID which matches the server name [Wed Sep 10 12:05:41.301000 2014] [ssl:warn] [pid 7840:tid 260] AH01915: Init: (localhost:80) You configured HTTPS(443) on the standard HTTP(80) port! [Wed Sep 10 12:05:41.373000 2014] [co warn] [pid 7840:tid 260] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run? [Wed Sep 10 12:05:41.616000 2014] [ssl:warn] [pid 7840:tid 260] AH01909: RSA certificate configured for localhost:80 does NOT include an ID which matches the server name [Wed Sep 10 12:05:41.617000 2014] [ssl:warn] [pid 7840:tid 260] AH01909: RSA certificate configured for 192.168.0.14:443 does NOT include an ID which matches the server name [Wed Sep 10 12:05:41.617000 2014] [ssl:warn] [pid 7840:tid 260] AH01915: Init: (localhost:80) You configured HTTPS(443) on the standard HTTP(80) port! [Wed Sep 10 12:05:41.659000 2014] [mpm_winnt:notice] [pid 7840:tid 260] AH00455: Apache/2.4.7 (Win32) OpenSSL/1.0.1e PHP/5.5.9 configured -- resuming normal operations [Wed Sep 10 12:05:41.659000 2014] [mpm_winnt:notice] [pid 7840:tid 260] AH00456: Apache Lounge VC11 Server built: Nov 21 2013 20:13:01 [Wed Sep 10 12:05:41.659000 2014] [co notice] [pid 7840:tid 260] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache' [Wed Sep 10 12:05:41.661000 2014] [mpm_winnt:notice] [pid 7840:tid 260] AH00418: Parent: Created child process 7032 [Wed Sep 10 12:05:42.319000 2014] [ssl:warn] [pid 7032:tid 272] AH01909: RSA certificate configured for localhost:80 does NOT include an ID which matches the server name [Wed Sep 10 12:05:42.321000 2014] [ssl:warn] [pid 7032:tid 272] AH01909: RSA certificate configured for 192.168.0.14:443 does NOT include an ID which matches the server name [Wed Sep 10 12:05:42.321000 2014] [ssl:warn] [pid 7032:tid 272] AH01915: Init: (localhost:80) You configured HTTPS(443) on the standard HTTP(80) port! [Wed Sep 10 12:05:42.645000 2014] [ssl:warn] [pid 7032:tid 272] AH01909: RSA certificate configured for localhost:80 does NOT include an ID which matches the server name [Wed Sep 10 12:05:42.646000 2014] [ssl:warn] [pid 7032:tid 272] AH01909: RSA certificate configured for 192.168.0.14:443 does NOT include an ID which matches the server name [Wed Sep 10 12:05:42.646000 2014] [ssl:warn] [pid 7032:tid 272] AH01915: Init: (localhost:80) You configured HTTPS(443) on the standard HTTP(80) port! [Wed Sep 10 12:05:42.688000 2014] [mpm_winnt:notice] [pid 7032:tid 272] AH00354: Child: Starting 150 worker threads. [Wed Sep 10 12:05:54.589000 2014] [authz_co error] [pid 7032:tid 1652] [client 192.168.0.14:3112] AH01630: client denied by server configuration: C:/xampp/htdocs/ [Wed Sep 10 12:05:54.682000 2014] [authz_co error] [pid 7032:tid 1652] [client 192.168.0.14:3112] AH01630: client denied by server configuration: C:/xampp/htdocs/favicon.icoIt says my server name does not match, So i changed the server name to: ( httpd-ssl.conf ) around line 80 ServerName 192.168.0.14:443 DocumentRoot to my httpd.conf document root My .key is in apache/conf/ssl.key my crt is in apache/conf/ssl.crt I hope this helps someone else! i had to post this after how much trouble it was causing me! Hi, I'm new to PHP and servers and wonder if its possible to send email from a PHP application that I created in Eclipse running on a MAC using MAMP. This would be done while connected on WiFi, lets say in a coffee shop. Thanx This topic has been moved to Installation on Linux. http://www.phpfreaks.com/forums/index.php?topic=321601.0 First thing: I formatted my drive today and fresh installs of Apache2, PHP5 and MariaDB on Linux Mint 17.1. No files have been messed with. Not one.
I created info.php and placed it in var/www dir. The file consists of one line: <?php phpinfo(); ?>
When I run it our of my web editor (Bluefish), instead of showing me on my web browser the PHP info page that's suppose to show, I get: <?php phpinfo(); ?>
I've been fighting this for two days! Done everything suggested by many others online...and that's why I had to scrub my drive; forgot all the files I augmented.
Does anyone know why my PHP files behave this way? I'd love to start working with PHP, but I can't until whatever's broken is fixed. Any ideas? Any suggestions? I'm at my wit's end with this.
Landslyde
When using cURL, how would I be able to include a call inside my get_all that basically will loop through all the next_page, get and store the data and then output it to $response->data when the "next_page" parameter becomes null? **Here is the method**: public function get_all() { return $response->data; } **This is what $response->data is returning as of now** (The cURL code wasn't included here): "paginator": { "total": 3092, "per_page": 500, "current_page": 2, "last_page": 7, "prev_page": "https://oc.com/api/v1/employees/?page=1", "next_page": "https://oc.com/api/v1/employees/?page=3" }, "data": [ { "id": 1592, etc.... Here are all of my unsuccessful attempts: public function get_all() { // $next_url = $response->paginator->next_page; // // foreach ($response as $next => $next_page) { // print_r2($next); // // if ($next_url !== null) { // $next_page = $response->data; // } // } // foreach ($response as $paginator => $next_page) { // if ($next_url !== null) { // $return[] = $response->data; // } // } // var_dump($response->paginator); // if ($next_url !== null) { // $this->get_all($path, $args, $next_url); // } return $response->data; } Edited October 30, 2019 by Sema314 Code: [Select] http://localhost/link.php?course=fitness link.php Code: [Select] <?php $course=$_GET[course]; echo "$course"; ?> I install the new apache it come out with this error "Use of undefined constant course - assumed 'course' in C:\xampp\htdocs\link.php on line 2". Previouly it is working fine on old one. Why it happened on new apache? Day
I'm using Codeigniter and inside the framework I create a file with PHP code If I try to point to it, the web-server doesn't deliver due to permission issues.
All this is done in a 'register function' where I create some fields in a SQL
If I put the user credentials into the database 'by hand' and likewise when I
I'm pretty sure this issue has been existed before and I'd appreciate any help.
Thanks for your help in forward. Gee Edited August 17, 2020 by bogushello guys. i ve been trying to write to a file using fwrite() inside my server directory. i am using this code: Code: [Select] ini_set('error_reporting', 'on'); error_reporting(E_ALL); echo substr(sprintf('%o', fileperms('skata')), -4); $fp = fopen("skata", "w"); fwrite($fp, "skata"); fclose($fp); the only thing that comes up to the browser is: Code: [Select] 0777 i have even pre-created the file "skata" in the diractory running as root and gave it permissions 777. i m not quite familiar with linux or apache permissions and i can tfigure out what's going wrong. i am running apache under fedora, and i would appreciate some guidelines here. |